module GraphQL::Schema::Member::Scoped
Public Instance Methods
(Module[untyped] subclass) → void
Source
# File lib/graphql/schema/member/scoped.rb, line 46 def inherited(subclass) super subclass.class_exec do @reauthorize_scoped_objects = nil #: bool? end end
Calls superclass method
(untyped items, GraphQL::Query::Context context) → untyped
Source
# File lib/graphql/schema/member/scoped.rb, line 28 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