Sha256: d7ccac233d0bb7ba55844bb3ed624e8f6bff2bca9b52fe5f2efb227e1728919c

Contents?: true

Size: 562 Bytes

Versions: 7

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Introspection
    SchemaField = GraphQL::Field.define do
      name("__schema")
      description("This GraphQL schema")
      type(GraphQL::Schema::LateBoundType.new("__Schema").to_non_null_type)
      resolve ->(o, a, ctx) {
        # Apply wrapping manually since this field isn't wrapped by instrumentation
        schema = ctx.query.schema
        schema_type = schema.introspection_system.schema_type
        schema_type.metadata[:object_class].new(schema, ctx.query.context)
      }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
graphql-1.8.0.pre9 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre8 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre7 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre6 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre5 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre4 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre3 lib/graphql/introspection/schema_field.rb