Class: GraphQL::Introspection::EntryPoints

Inherits:
Introspection::BaseObject
  • Object
show all
Defined in:
lib/graphql/introspection/entry_points.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.__schema(context) ⇒ Object



10
11
12
13
14
15
# File 'lib/graphql/introspection/entry_points.rb', line 10

def self.__schema(context)
  # 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

.__type(context, name:) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/graphql/introspection/entry_points.rb', line 25

def self.__type(context, 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

Instance Method Details

#__schemaObject



17
18
19
# File 'lib/graphql/introspection/entry_points.rb', line 17

def __schema
  self.class.__schema(context)
end

#__type(name:) ⇒ Object



21
22
23
# File 'lib/graphql/introspection/entry_points.rb', line 21

def __type(name:)
  self.class.__type(context, name: name)
end