Class: GraphQL::Schema::IntrospectionSystem
- Inherits:
-
Object
- Object
- GraphQL::Schema::IntrospectionSystem
- Defined in:
- lib/graphql/schema/introspection_system.rb
Defined Under Namespace
Classes: PerFieldProxyResolve
Instance Attribute Summary collapse
-
#schema_type ⇒ Object
readonly
Returns the value of attribute schema_type.
-
#type_type ⇒ Object
readonly
Returns the value of attribute type_type.
-
#typename_field ⇒ Object
readonly
Returns the value of attribute typename_field.
Instance Method Summary collapse
-
#dynamic_field(name:) ⇒ Object
-
#dynamic_fields ⇒ Object
-
#entry_point(name:) ⇒ Object
-
#entry_points ⇒ Object
-
#initialize(schema) ⇒ IntrospectionSystem
constructor
A new instance of IntrospectionSystem.
-
#object_types ⇒ Object
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 24 25 26 27 28 |
# 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 = if schema.disable_introspection_entry_points {} else get_fields_from_class(class_sym: :EntryPoints) end @dynamic_fields = get_fields_from_class(class_sym: :DynamicFields) end |
Instance Attribute Details
#schema_type ⇒ Object (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_type ⇒ Object (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_field ⇒ Object (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
55 56 57 |
# File 'lib/graphql/schema/introspection_system.rb', line 55 def dynamic_field(name:) @dynamic_fields[name] end |
#dynamic_fields ⇒ Object
51 52 53 |
# File 'lib/graphql/schema/introspection_system.rb', line 51 def dynamic_fields @dynamic_fields.values end |
#entry_point(name:) ⇒ Object
47 48 49 |
# File 'lib/graphql/schema/introspection_system.rb', line 47 def entry_point(name:) @entry_point_fields[name] end |
#entry_points ⇒ Object
43 44 45 |
# File 'lib/graphql/schema/introspection_system.rb', line 43 def entry_points @entry_point_fields.values end |
#object_types ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/graphql/schema/introspection_system.rb', line 30 def object_types [ @schema_type, @type_type, @field_type, @directive_type, @enum_value_type, @input_value_type, @type_kind_enum, @directive_location_enum, ] end |