Module: SearchObject::Plugin::Graphql::Helper

Defined in:
lib/search_object/plugin/graphql.rb

Overview

:api: private

Class Method Summary collapse

Class Method Details

.build_argument(name, options) ⇒ Object



73
74
75
76
77
78
79
80
# File 'lib/search_object/plugin/graphql.rb', line 73

def build_argument(name, options)
  argument = GraphQL::Argument.new
  argument.name = name.to_s
  argument.type = options.fetch(:type) { raise MissingTypeDefinitionError, name }
  argument.default_value = options[:default] if options.key? :default
  argument.description = options[:description] if options.key? :description
  argument
end