module GraphQL::Schema::Member::Scoped
Public Instance Methods
Source
# File lib/graphql/schema/member/scoped.rb, line 42 def inherited(subclass) super subclass.class_exec do @reauthorize_scoped_objects = nil end end
Calls superclass method
# File lib/graphql/schema/member/scoped.rb, line 26 def scope_items(items, context) items end
This is called when a field has scope: true. The fieldβs return type class receives this call.
By default, itβs a no-op. Override it to scope your objects.
Parameters
-
items(Object) β Some list-like object (eg, Array, ActiveRecord::Relation) -
context(GraphQL::Query::Context)
Returns
-
Objectβ Another list-like object, scoped to the current context