Sha256: c0fe306fb002aef94b43993e694a4ca8507563221e656ffca5d6365ea64ea6ea

Contents?: true

Size: 1.04 KB

Versions: 15

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true
module GraphQL
  module Introspection
    class EntryPoints < Introspection::BaseObject
      field :__schema, GraphQL::Schema::LateBoundType.new("__Schema"), "This GraphQL schema", null: false
      field :__type, GraphQL::Schema::LateBoundType.new("__Type"), "A type in the GraphQL system", null: true do
        argument :name, String, required: true
      end

      def __schema
        # Apply wrapping manually since this field isn't wrapped by instrumentation
        schema = @context.query.schema
        schema_type = schema.introspection_system.schema_type
        schema_type.metadata[:type_class].authorized_new(schema, @context)
      end

      def __type(name:)
        type = @context.warden.get_type(name)
        if type
          # Apply wrapping manually since this field isn't wrapped by instrumentation
          type_type = @context.schema.introspection_system.type_type
          type_type.metadata[:type_class].authorized_new(type, @context)
        else
          nil
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
graphql-1.8.18 lib/graphql/introspection/entry_points.rb
graphql-1.8.17 lib/graphql/introspection/entry_points.rb
graphql-1.8.16 lib/graphql/introspection/entry_points.rb
graphql-1.8.15 lib/graphql/introspection/entry_points.rb
graphql-1.8.14 lib/graphql/introspection/entry_points.rb
graphql-1.8.13 lib/graphql/introspection/entry_points.rb
graphql-1.8.12 lib/graphql/introspection/entry_points.rb
graphql-1.8.11 lib/graphql/introspection/entry_points.rb
graphql-1.8.10 lib/graphql/introspection/entry_points.rb
graphql-1.8.9 lib/graphql/introspection/entry_points.rb
graphql-1.8.8 lib/graphql/introspection/entry_points.rb
graphql-1.8.7 lib/graphql/introspection/entry_points.rb
graphql-1.8.6 lib/graphql/introspection/entry_points.rb
graphql-1.8.5 lib/graphql/introspection/entry_points.rb
graphql-1.8.4 lib/graphql/introspection/entry_points.rb