Class: GraphQL::Schema::Mutation
- Extended by:
- GraphQL::Schema::Member::HasFields, Resolver::HasPayloadType
- Defined in:
- lib/graphql/schema/mutation.rb
Overview
This base class accepts configuration for a mutation root field, then it can be hooked up to your mutation root object type.
If you want to customize how this class generates types, in your base class,
override the various generate_*
methods.
Direct Known Subclasses
Constant Summary
Constants included from GraphQL::Schema::Member::HasFields
GraphQL::Schema::Member::HasFields::CONFLICT_FIELD_NAMES, GraphQL::Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, GraphQL::Schema::Member::HasFields::RUBY_KEYWORDS
Constants included from Resolver::HasPayloadType
Resolver::HasPayloadType::NO_INTERFACES
Constants included from GraphQL::Schema::Member::HasArguments
GraphQL::Schema::Member::HasArguments::NO_ARGUMENTS
Constants included from FindInheritedValue::EmptyObjects
FindInheritedValue::EmptyObjects::EMPTY_ARRAY, FindInheritedValue::EmptyObjects::EMPTY_HASH
Constants included from GraphQL::Schema::Member::GraphQLTypeNames
GraphQL::Schema::Member::GraphQLTypeNames::Boolean, GraphQL::Schema::Member::GraphQLTypeNames::ID, GraphQL::Schema::Member::GraphQLTypeNames::Int
Instance Attribute Summary
Attributes inherited from Resolver
Class Method Summary collapse
-
.field(*args, **kwargs, &block) ⇒ Object
Override this method to handle legacy-style usages of
MyMutation.field
. -
.visible?(context) ⇒ Boolean
Methods included from GraphQL::Schema::Member::HasFields
add_field, field, field_class, fields, get_field, global_id_field, own_fields
Methods included from Resolver::HasPayloadType
field_class, object_class, payload_type
Methods inherited from Resolver
argument, #arguments, arguments_loads_as_type, #authorized?, broadcastable, broadcastable?, complexity, #dataloader, extension, extensions, extras, field_options, has_max_page_size?, #initialize, max_page_size, null, #ready?, #resolve, resolve_method, #resolve_with_support, type, type_expr
Methods included from GraphQL::Schema::Member::BaseDSLMethods
#accessible?, #authorized?, #default_graphql_name, #description, #graphql_name, #introspection, #introspection?, #mutation, #name, #overridden_graphql_name, #to_graphql, #visible?
Methods included from GraphQL::Schema::Member::HasArguments
#add_argument, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #validate_directive_argument
Methods included from GraphQL::Schema::Member::HasValidators
Methods included from GraphQL::Schema::Member::HasPath
Constructor Details
This class inherits a constructor from GraphQL::Schema::Resolver
Class Method Details
.field(*args, **kwargs, &block) ⇒ Object
Override this method to handle legacy-style usages of MyMutation.field
67 68 69 70 71 72 73 |
# File 'lib/graphql/schema/mutation.rb', line 67 def field(*args, **kwargs, &block) if args.empty? raise ArgumentError, "#{name}.field is used for adding fields to this mutation. Use `mutation: #{name}` to attach this mutation instead." else super end end |
.visible?(context) ⇒ Boolean
75 76 77 |
# File 'lib/graphql/schema/mutation.rb', line 75 def visible?(context) true end |