Sha256: 02e6cdeeae59c50c7da516532b0c44ffa54493e9a724b63838f56a822e4f6a81

Contents?: true

Size: 1.31 KB

Versions: 24

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true
require "spec_helper"

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

  it "exposes the schema" do
    expected = { "data" => {
      "__schema" => {
        "types" => Dummy::Schema.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"},
            {"name"=>"valueWithExecutionError"},
          ]
        },
        "mutationType"=> {
          "fields"=>[
            {"name"=>"pushValue"},
            {"name"=>"replaceValues"},
          ]
        },
      }
    }}
    assert_equal(expected, result)
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
graphql-1.6.4 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.15 spec/graphql/introspection/schema_type_spec.rb
graphql-1.6.3 spec/graphql/introspection/schema_type_spec.rb
graphql-1.6.2 spec/graphql/introspection/schema_type_spec.rb
graphql-1.6.1 spec/graphql/introspection/schema_type_spec.rb
graphql-1.6.0 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.14 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.13 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.7.1 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.12 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.11 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.10 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.9 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.8 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.7 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.6 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.5 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.4 spec/graphql/introspection/schema_type_spec.rb
graphql-1.5.3 spec/graphql/introspection/schema_type_spec.rb
graphql-1.4.5 spec/graphql/introspection/schema_type_spec.rb