Module: GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments Private
- 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.
Instance Method Summary collapse
-
#all_argument_definitions ⇒ Object
private
-
#any_arguments? ⇒ Boolean
private
-
#arguments(context = GraphQL::Query::NullContext.instance) ⇒ Object
private
-
#get_argument(argument_name, context = GraphQL::Query::NullContext.instance) ⇒ Object
private
Instance Method Details
#all_argument_definitions ⇒ 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.
123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 123 def all_argument_definitions all_defns = {} ancestors.reverse_each do |ancestor| if ancestor.respond_to?(:own_arguments) all_defns.merge!(ancestor.own_arguments) end end all_defns = all_defns.values all_defns.flatten! all_defns end |
#any_arguments? ⇒ Boolean
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.
119 120 121 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 119 def any_arguments? super || superclass.any_arguments? end |
#arguments(context = GraphQL::Query::NullContext.instance) ⇒ 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.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 103 def arguments(context = GraphQL::Query::NullContext.instance) own_arguments = super inherited_arguments = superclass.arguments(context) if own_arguments.any? if inherited_arguments.any? # Local definitions override inherited ones inherited_arguments.merge(own_arguments) else own_arguments end else inherited_arguments end end |
#get_argument(argument_name, context = GraphQL::Query::NullContext.instance) ⇒ 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.
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 136 def get_argument(argument_name, context = GraphQL::Query::NullContext.instance) warden = Warden.from_context(context) skip_visible = context.respond_to?(:types) && context.types.is_a?(GraphQL::Schema::Visibility::Subset) for ancestor in ancestors if ancestor.respond_to?(:own_arguments) && (a = ancestor.own_arguments[argument_name]) && (skip_visible || (a = Warden.visible_entry?(:visible_argument?, a, context, warden))) return a end end nil end |