Sha256: 9f3cd61463a3adf61735450ecf627fb8d0a10533e6ac2767903421e2812ab3d2

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 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"=>"cheese"},
            {"name"=>"milk"},
            {"name"=>"dairy"},
            {"name"=>"fromSource"},
            {"name"=>"favoriteEdible"},
            {"name"=>"cow"},
            {"name"=>"searchDairy"},
            {"name"=>"error"},
            {"name"=>"maybeNull"},
          ]
        },
        "mutationType"=> {
          "fields"=>[
            {"name"=>"pushValue"},
            {"name"=>"replaceValues"},
          ]
        },
      }
    }}
    assert_equal(expected, result)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
graphql-0.10.9 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.8 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.7 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.6 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.5 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.4 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.3 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.2 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.1 spec/graphql/introspection/schema_type_spec.rb
graphql-0.10.0 spec/graphql/introspection/schema_type_spec.rb
graphql-0.9.5 spec/graphql/introspection/schema_type_spec.rb
graphql-0.9.4 spec/graphql/introspection/schema_type_spec.rb