Class: GraphQL::Interface
- Inherits:
-
ObjectType
- Object
- ObjectType
- GraphQL::Interface
- Defined in:
- lib/graph_ql/types/interface.rb
Instance Method Summary collapse
- #kind ⇒ Object
- #possible_types ⇒ Object
-
#resolve_type(object) ⇒ Object
Might have to override this in your own interface.
Methods inherited from ObjectType
#==, #fields, #fields=, #initialize, #interfaces, #to_s
Methods included from Definable
Methods included from NonNullWithBang
Constructor Details
This class inherits a constructor from GraphQL::ObjectType
Instance Method Details
#kind ⇒ Object
2 3 4 |
# File 'lib/graph_ql/types/interface.rb', line 2 def kind GraphQL::TypeKinds::INTERFACE end |
#possible_types ⇒ Object
6 7 8 |
# File 'lib/graph_ql/types/interface.rb', line 6 def possible_types @possible_types ||= [] end |
#resolve_type(object) ⇒ Object
Might have to override this in your own interface
11 12 13 |
# File 'lib/graph_ql/types/interface.rb', line 11 def resolve_type(object) @possible_types.find {|t| t.name == object.class.name } end |