Class: GraphQL::Argument

Inherits:
Object
  • Object
show all
Includes:
DefinitionHelpers::DefinedByConfig
Defined in:
lib/graphql/argument.rb

Overview

Used for defined arguments (Field, InputObjectType)

Examples:

defining an argument for a field

GraphQL::Field.define do
  # ...
  argument :favoriteFood, types.String, "Favorite thing to eat", default_value: "pizza"
end

defining an input field for an InputObjectType

GraphQL::InputObjectType.define do
  input_field :newName, !types.String
end

Instance Attribute Summary collapse

Method Summary

Methods included from DefinitionHelpers::DefinedByConfig

included

Instance Attribute Details

#default_valueObject

Returns the value of attribute default_value.



17
18
19
# File 'lib/graphql/argument.rb', line 17

def default_value
  @default_value
end

#descriptionObject

Returns the value of attribute description.



17
18
19
# File 'lib/graphql/argument.rb', line 17

def description
  @description
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/graphql/argument.rb', line 17

def name
  @name
end

#typeObject

Returns the value of attribute type.



17
18
19
# File 'lib/graphql/argument.rb', line 17

def type
  @type
end