Sha256: 6ea7b1c7c32a3b24bac82f9f2bba69cc146b300f44f602635c6d2db97bf9f3ca

Contents?: true

Size: 1.23 KB

Versions: 20

Compression:

Stored size: 1.23 KB

Contents

require "spec_helper"

describe GraphQL::Introspection::SchemaType do
  let(:query_string) {%|
    query getSchema {
      __schema {
        types { name }
        queryType { fields { name }}
        mutationType { fields { name }}
      }
    }
  |}
  let(:result) { DummySchema.execute(query_string) }

  it "exposes the schema" do
    expected = { "data" => {
      "__schema" => {
        "types" => DummySchema.types.values.map { |t| t.name.nil? ? (p t; raise("no name for #{t}")) : {"name" => t.name} },
        "queryType"=>{
          "fields"=>[
            {"name"=>"allDairy"},
            {"name"=>"allEdible"},
            {"name"=>"cheese"},
            {"name"=>"cow"},
            {"name"=>"dairy"},
            {"name"=>"deepNonNull"},
            {"name"=>"error"},
            {"name"=>"executionError"},
            {"name"=>"favoriteEdible"},
            {"name"=>"fromSource"},
            {"name"=>"maybeNull"},
            {"name"=>"milk"},
            {"name"=>"root"},
            {"name"=>"searchDairy"},
          ]
        },
        "mutationType"=> {
          "fields"=>[
            {"name"=>"pushValue"},
            {"name"=>"replaceValues"},
          ]
        },
      }
    }}
    assert_equal(expected, result)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
graphql-1.1.0 spec/graphql/introspection/schema_type_spec.rb
graphql-1.0.0 spec/graphql/introspection/schema_type_spec.rb
graphql-0.19.4 spec/graphql/introspection/schema_type_spec.rb
graphql-0.19.3 spec/graphql/introspection/schema_type_spec.rb
graphql-0.19.2 spec/graphql/introspection/schema_type_spec.rb
graphql-0.19.1 spec/graphql/introspection/schema_type_spec.rb
graphql-0.19.0 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.15 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.14 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.13 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.12 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.11 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.10 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.9 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.8 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.7 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.6 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.5 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.4 spec/graphql/introspection/schema_type_spec.rb
graphql-0.18.3 spec/graphql/introspection/schema_type_spec.rb