Class: GraphQL::InterfaceType
- Includes:
- BaseType::HasPossibleTypes
- Defined in:
- lib/graphql/interface_type.rb
Overview
A collection of types which implement the same fields
Constant Summary
Constants included from BaseType::HasPossibleTypes
BaseType::HasPossibleTypes::DEFAULT_RESOLVE_TYPE
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#all_fields ⇒ Array<GraphQL::Field>
All fields on this type.
-
#get_field(field_name) ⇒ GraphQL::Field
The defined field for ‘field_name`.
- #kind ⇒ Object
-
#possible_types ⇒ Array<GraphQL::ObjectType>
Types which declare that they implement this interface.
Methods included from BaseType::HasPossibleTypes
#include?, #resolve_type, #resolve_type=
Methods inherited from BaseType
#==, #coerce_input, #resolve_type, #to_list_type, #to_non_null_type, #to_s, #unwrap, #valid_input?, #validate_input
Methods included from DefinitionHelpers::DefinedByConfig
Methods included from DefinitionHelpers::NonNullWithBang
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
16 17 18 |
# File 'lib/graphql/interface_type.rb', line 16 def description @description end |
#fields ⇒ Object
Returns the value of attribute fields.
16 17 18 |
# File 'lib/graphql/interface_type.rb', line 16 def fields @fields end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/graphql/interface_type.rb', line 16 def name @name end |
Instance Method Details
#all_fields ⇒ Array<GraphQL::Field>
Returns All fields on this type.
33 34 35 |
# File 'lib/graphql/interface_type.rb', line 33 def all_fields fields.values end |
#get_field(field_name) ⇒ GraphQL::Field
Returns The defined field for ‘field_name`.
28 29 30 |
# File 'lib/graphql/interface_type.rb', line 28 def get_field(field_name) fields[field_name] end |
#kind ⇒ Object
18 19 20 |
# File 'lib/graphql/interface_type.rb', line 18 def kind GraphQL::TypeKinds::INTERFACE end |
#possible_types ⇒ Array<GraphQL::ObjectType>
Returns Types which declare that they implement this interface.
23 24 25 |
# File 'lib/graphql/interface_type.rb', line 23 def possible_types @possible_types ||= [] end |