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, require_defined_arguments = true) ⇒ 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.
146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 146 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.
142 143 144 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 142 def any_arguments? super || superclass.any_arguments? end |
#arguments(context = GraphQL::Query::NullContext.instance, require_defined_arguments = true) ⇒ 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.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 126 def arguments(context = GraphQL::Query::NullContext.instance, require_defined_arguments = true) own_arguments = super(context, require_defined_arguments) inherited_arguments = superclass.arguments(context, false) if !own_arguments.empty? if !inherited_arguments.empty? # 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.
159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/graphql/schema/member/has_arguments.rb', line 159 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::Profile) 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 |