Module: GraphQL::Schema::Member::HasArguments Private

Included in:
Field, InputObject, Resolver
Defined in:
lib/graphql/schema/member/has_arguments.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Modules: ArgumentClassAccessor

Instance Method Summary collapse

Instance Method Details

#argument(*args, **kwargs, &block) ⇒ GraphQL::Schema::Argument

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns An instance of arguments_class, created from *args

Returns:

See Also:

  • for parameters


16
17
18
19
20
# File 'lib/graphql/schema/member/has_arguments.rb', line 16

def argument(*args, **kwargs, &block)
  kwargs[:owner] = self
  arg_defn = self.argument_class.new(*args, **kwargs, &block)
  own_arguments[arg_defn.name] = arg_defn
end

#argument_class(new_arg_class = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • new_arg_class (Class) (defaults to: nil)

    A class to use for building argument definitions



30
31
32
# File 'lib/graphql/schema/member/has_arguments.rb', line 30

def argument_class(new_arg_class = nil)
  self.class.argument_class(new_arg_class)
end

#argumentsHash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions

Returns:

  • (Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions)

    Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions



23
24
25
26
27
# File 'lib/graphql/schema/member/has_arguments.rb', line 23

def arguments
  inherited_arguments = ((self.is_a?(Class) && superclass.respond_to?(:arguments)) ? superclass.arguments : {})
  # Local definitions override inherited ones
  inherited_arguments.merge(own_arguments)
end

#own_argumentsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
# File 'lib/graphql/schema/member/has_arguments.rb', line 44

def own_arguments
  @own_arguments ||= {}
end