Class: GraphQL::Schema::IntrospectionSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/schema/introspection_system.rb

Defined Under Namespace

Classes: PerFieldProxyResolve

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ IntrospectionSystem

Returns a new instance of IntrospectionSystem.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/graphql/schema/introspection_system.rb', line 7

def initialize(schema)
  @schema = schema
  @built_in_namespace = GraphQL::Introspection
  @custom_namespace = schema.introspection_namespace || @built_in_namespace

  # Use to-graphql to avoid sharing with any previous instantiations
  @schema_type = load_constant(:SchemaType).to_graphql
  @type_type = load_constant(:TypeType).to_graphql
  @field_type = load_constant(:FieldType).to_graphql
  @directive_type = load_constant(:DirectiveType).to_graphql
  @enum_value_type = load_constant(:EnumValueType).to_graphql
  @input_value_type = load_constant(:InputValueType).to_graphql
  @type_kind_enum = load_constant(:TypeKindEnum).to_graphql
  @directive_location_enum = load_constant(:DirectiveLocationEnum).to_graphql
  @entry_point_fields = get_fields_from_class(class_sym: :EntryPoints)
  @dynamic_fields = get_fields_from_class(class_sym: :DynamicFields)
end

Instance Attribute Details

#schema_typeObject (readonly)

Returns the value of attribute schema_type.



5
6
7
# File 'lib/graphql/schema/introspection_system.rb', line 5

def schema_type
  @schema_type
end

#type_typeObject (readonly)

Returns the value of attribute type_type.



5
6
7
# File 'lib/graphql/schema/introspection_system.rb', line 5

def type_type
  @type_type
end

#typename_fieldObject (readonly)

Returns the value of attribute typename_field.



5
6
7
# File 'lib/graphql/schema/introspection_system.rb', line 5

def typename_field
  @typename_field
end

Instance Method Details

#dynamic_field(name:) ⇒ Object



50
51
52
# File 'lib/graphql/schema/introspection_system.rb', line 50

def dynamic_field(name:)
  @dynamic_fields[name]
end

#dynamic_fieldsObject



46
47
48
# File 'lib/graphql/schema/introspection_system.rb', line 46

def dynamic_fields
  @dynamic_fields.values
end

#entry_point(name:) ⇒ Object



42
43
44
# File 'lib/graphql/schema/introspection_system.rb', line 42

def entry_point(name:)
  @entry_point_fields[name]
end

#entry_pointsObject



38
39
40
# File 'lib/graphql/schema/introspection_system.rb', line 38

def entry_points
  @entry_point_fields.values
end

#object_typesObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/graphql/schema/introspection_system.rb', line 25

def object_types
  [
    @schema_type,
    @type_type,
    @field_type,
    @directive_type,
    @enum_value_type,
    @input_value_type,
    @type_kind_enum,
    @directive_location_enum,
  ]
end