Sha256: 83f2821b3eb3b07cddfd5bd1fdcec0c29f1f6075823928b6aaf410a2c9b7da28

Contents?: true

Size: 766 Bytes

Versions: 8

Compression:

Stored size: 766 Bytes

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" do
        argument :name, String
      end

      def __schema
        # Apply wrapping manually since this field isn't wrapped by instrumentation
        schema = @context.query.schema
        schema_type = schema.introspection_system.types["__Schema"]
        schema_type.wrap(schema, @context)
      end

      def __type(name:)
        context.warden.reachable_type?(name) ? context.warden.get_type(name) : nil
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
graphql-2.0.31 lib/graphql/introspection/entry_points.rb
graphql-2.0.29 lib/graphql/introspection/entry_points.rb
graphql-2.0.28 lib/graphql/introspection/entry_points.rb
graphql-2.1.0 lib/graphql/introspection/entry_points.rb
graphql-2.0.27 lib/graphql/introspection/entry_points.rb
graphql-2.0.26 lib/graphql/introspection/entry_points.rb
graphql-2.0.25 lib/graphql/introspection/entry_points.rb
graphql-2.0.24 lib/graphql/introspection/entry_points.rb