Sha256: 85e766a7cb34b7011b81043f2efa408985f4005267d43396b5ef86a3cf78c98d
Contents?: true
Size: 1.31 KB
Versions: 2
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) { 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"}, {"name"=>"valueWithExecutionError"}, ] }, "mutationType"=> { "fields"=>[ {"name"=>"pushValue"}, {"name"=>"replaceValues"}, ] }, } }} assert_equal(expected, result) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
graphql-1.4.0 | spec/graphql/introspection/schema_type_spec.rb |
graphql-1.3.0 | spec/graphql/introspection/schema_type_spec.rb |