Class: Rails::GraphQL::Type::Object::FieldObject
- Inherits:
-
Rails::GraphQL::Type::Object
- Object
- Rails::GraphQL::Type
- Rails::GraphQL::Type::Object
- Rails::GraphQL::Type::Object::FieldObject
- Defined in:
- lib/rails/graphql/type/object/field_object.rb
Overview
The introspection object for a field on objects and interfaces
Constant Summary
Constants inherited from Rails::GraphQL::Type
Instance Attribute Summary
Attributes included from Helpers::Instantiable
Instance Method Summary collapse
- #args ⇒ Object
- #build_type ⇒ Object
- #deprecated? ⇒ Boolean
- #deprecation_reason ⇒ Object
- #description ⇒ Object
Methods inherited from Rails::GraphQL::Type::Object
=~, implements, implements?, inspect, valid_member?
Methods included from Helpers::WithAssignment
#assigned?, #assigned_class, #assigned_to, #assigned_to=, extended, #register!, #safe_assigned_class, #valid_assignment?
Methods included from Helpers::WithFields
#change_field, #configure_field, #disable_fields, #enable_fields, #enabled_fields, extended, #field, #field_names, #find_by_gid, #find_field, #find_field!, #has_field?, #import, #import_all, #proxy_field, #safe_field, #validate!
Methods inherited from Rails::GraphQL::Type
=~, base_type, create!, decorate, find_by_gid, gid_base_class, input_type?, kind, kind_enum, leaf_type?, operational?, output_type?, to_gql_backtrace
Methods included from Helpers::WithDirectives
#all_directive_events, #all_directive_listeners, #directive_events?, #directive_listeners?, extended, included, #initialize_copy, #use, #using?, #validate!
Methods included from Helpers::WithGlobalID
Methods included from Helpers::Registerable
#aliases, extended, #inherited, #register!, #registered?
Instance Method Details
#args ⇒ Object
48 49 50 |
# File 'lib/rails/graphql/type/object/field_object.rb', line 48 def args all_arguments&.values || EMPTY_ARRAY end |
#build_type ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rails/graphql/type/object/field_object.rb', line 36 def build_type result = current.type_klass if current.array? result = fake_type_object(:non_null, result) unless current.nullable? result = fake_type_object(:list, result) end result = fake_type_object(:non_null, result) unless current.null? result end |
#deprecated? ⇒ Boolean
52 53 54 |
# File 'lib/rails/graphql/type/object/field_object.rb', line 52 def deprecated? !deprecated_instance.nil? end |
#deprecation_reason ⇒ Object
56 57 58 |
# File 'lib/rails/graphql/type/object/field_object.rb', line 56 def deprecation_reason deprecated_instance&.args&.reason end |
#description ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/rails/graphql/type/object/field_object.rb', line 28 def description if current.method(:description).arity == 0 current.description else current.description(schema.namespace) end end |