Class: GraphQL::Interface
- Inherits:
-
ObjectType
- Object
- ObjectType
- GraphQL::Interface
- Defined in:
- lib/graph_ql/interface.rb
Instance Method Summary collapse
- #kind ⇒ Object
- #possible_types ⇒ Object
-
#resolve_type(object) ⇒ Object
Might have to override this in your own interface.
- #to_s ⇒ Object
Methods inherited from ObjectType
#fields, #fields=, #initialize, #inspect, #interfaces
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/interface.rb', line 2 def kind GraphQL::TypeKinds::INTERFACE end |
#possible_types ⇒ Object
6 7 8 |
# File 'lib/graph_ql/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/interface.rb', line 11 def resolve_type(object) @possible_types.find {|t| t.name == object.class.name } end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/graph_ql/interface.rb', line 15 def to_s "<GraphQL::Interface #{name}>" end |