Module: SearchObject::Plugin::Graphql::ClassMethods
- Defined in:
- lib/search_object/plugin/graphql.rb
Instance Method Summary collapse
- #option(name, options = {}, &block) ⇒ Object
-
#types ⇒ Object
NOTE(rstankov): This is removed in GraphQL 2.0.0.
Instance Method Details
#option(name, options = {}, &block) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/search_object/plugin/graphql.rb', line 32 def option(name, = {}, &block) type = .fetch(:type) { raise MissingTypeDefinitionError, name } = [:argument_options] || {} [:required] = [:required] || false [:camelize] = [:camelize] if .include?(:camelize) [:default_value] = [:default] if .include?(:default) [:description] = [:description] if .include?(:description) [:deprecation_reason] = [:deprecation_reason] if .include?(:deprecation_reason) argument(name.to_s, type, **) [:enum] = type.values.map { |value, enum_value| enum_value.value || value } if type.respond_to?(:values) super(name, , &block) end |
#types ⇒ Object
NOTE(rstankov): This is removed in GraphQL 2.0.0
52 53 54 |
# File 'lib/search_object/plugin/graphql.rb', line 52 def types GraphQL::Define::TypeDefiner.instance end |