Sha256: 0ab36ca36b692fb5782b98618eb189f1490525721c6bc1e39af5b45da0374206

Contents?: true

Size: 961 Bytes

Versions: 16

Compression:

Stored size: 961 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, dynamic_introspection: true
      field :__type, GraphQL::Schema::LateBoundType.new("__Type"), "A type in the GraphQL system", dynamic_introspection: true do
        argument :name, String
      end

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

      def __type(name:)
        if context.warden.reachable_type?(name)
          context.warden.get_type(name)
        elsif (type = context.schema.extra_types.find { |t| t.graphql_name == name })
          type
        else
          nil
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
graphql-2.2.16 lib/graphql/introspection/entry_points.rb
graphql-2.3.7 lib/graphql/introspection/entry_points.rb
graphql-2.3.6 lib/graphql/introspection/entry_points.rb
graphql-2.3.5 lib/graphql/introspection/entry_points.rb
graphql-2.3.2 lib/graphql/introspection/entry_points.rb
graphql-2.3.1 lib/graphql/introspection/entry_points.rb
graphql-2.3.0 lib/graphql/introspection/entry_points.rb
graphql-2.2.14 lib/graphql/introspection/entry_points.rb
graphql-2.2.13 lib/graphql/introspection/entry_points.rb
graphql-2.2.12 lib/graphql/introspection/entry_points.rb
graphql-2.2.11 lib/graphql/introspection/entry_points.rb
graphql-2.2.10 lib/graphql/introspection/entry_points.rb
graphql-2.2.9 lib/graphql/introspection/entry_points.rb
graphql-2.2.8 lib/graphql/introspection/entry_points.rb
graphql-2.2.7 lib/graphql/introspection/entry_points.rb
graphql-2.2.6 lib/graphql/introspection/entry_points.rb