Method: GraphQL::Schema::Resolver::HasPayloadType#object_class
- Defined in:
- lib/graphql/schema/resolver/has_payload_type.rb
#object_class(new_class = nil) ⇒ Class
An object class to use for deriving return types
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/graphql/schema/resolver/has_payload_type.rb', line 49 def object_class(new_class = nil) if new_class if defined?(@payload_type) raise "Can't configure `object_class(...)` after the payload type has already been initialized. Move this configuration higher up the class definition." end @object_class = new_class else @object_class || find_inherited_value(:object_class, GraphQL::Schema::Object) end end |