module GraphQL::Schema::Member::Scoped

Public Instance Methods

scope_items(items, context) click to toggle source

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.

@param items [Object] Some list-like object (eg, Array, ActiveRecord::Relation) @param context [GraphQL::Query::Context] @return [Object] Another list-like object, scoped to the current context

# File lib/graphql/schema/member/scoped.rb, line 15
def scope_items(items, context)
  items
end