Sha256: e0adf5ec38f970bb45c8684d79d3851fe9a52660a4c5ee0349adc694f04ab1d2

Contents?: true

Size: 560 Bytes

Versions: 3

Compression:

Stored size: 560 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[:type_class].new(schema, ctx.query.context)
      }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphql-1.8.0 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre11 lib/graphql/introspection/schema_field.rb
graphql-1.8.0.pre10 lib/graphql/introspection/schema_field.rb