Sha256: 40e706620daf7e4dc0b8a54975dc1c1a08f6c92bd5d1756c77023811c5cdccb0

Contents?: true

Size: 972 Bytes

Versions: 27

Compression:

Stored size: 972 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.types.reachable_type?(name) && (type = context.types.type(name))
          type
        elsif (type = context.schema.extra_types.find { |t| t.graphql_name == name })
          type
        else
          nil
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
graphql-2.4.14 lib/graphql/introspection/entry_points.rb
graphql-2.3.22 lib/graphql/introspection/entry_points.rb
graphql-2.3.21 lib/graphql/introspection/entry_points.rb
graphql-2.4.13 lib/graphql/introspection/entry_points.rb
graphql-2.4.12 lib/graphql/introspection/entry_points.rb
graphql-2.4.11 lib/graphql/introspection/entry_points.rb
graphql-2.4.10 lib/graphql/introspection/entry_points.rb
graphql-2.4.9 lib/graphql/introspection/entry_points.rb
graphql-2.4.8 lib/graphql/introspection/entry_points.rb
graphql-2.4.7 lib/graphql/introspection/entry_points.rb
graphql-2.4.6 lib/graphql/introspection/entry_points.rb
graphql-2.4.5 lib/graphql/introspection/entry_points.rb
graphql-2.4.4 lib/graphql/introspection/entry_points.rb
graphql-2.4.3 lib/graphql/introspection/entry_points.rb
graphql-2.4.2 lib/graphql/introspection/entry_points.rb
graphql-2.4.1 lib/graphql/introspection/entry_points.rb
graphql-2.4.0 lib/graphql/introspection/entry_points.rb
graphql-2.3.20 lib/graphql/introspection/entry_points.rb
graphql-2.3.19 lib/graphql/introspection/entry_points.rb
graphql-2.3.18 lib/graphql/introspection/entry_points.rb