Method: GraphQL::Schema::Interface::DefinitionMethods#orphan_types
- Defined in:
- lib/graphql/schema/interface.rb
#orphan_types(*types) ⇒ Array<Module, Class>
Register other Interface or Object types as implementers of this Interface.
When those Interfaces or Objects aren't used as the return values of fields, they may have to be registered using this method so that GraphQL-Ruby can find them.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/graphql/schema/interface.rb', line 93 def orphan_types(*types) if !types.empty? @orphan_types ||= [] @orphan_types.concat(types) else if defined?(@orphan_types) all_orphan_types = @orphan_types.dup if defined?(super) all_orphan_types += super all_orphan_types.uniq! end all_orphan_types elsif defined?(super) super else EmptyObjects::EMPTY_ARRAY end end end |