You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works when scope_items really did something, but not if you want to skip authorization altogether. For example, if you've got a list of items from an external service, and you want to return them as-is, without scoping or authorization, you'd have to do this:
defself.scope_items(items,ctx)items.dup# Make a shallow copy so GraphQL-Ruby will know that we authorized this listend
I bet there's a more robust way to implement this check (and maybe to implement the runtime metadata, too). I'm going to consider it for 3.0.
The text was updated successfully, but these errors were encountered:
Currently, this library checks for whether or not items were scoped by using object equality:
graphql-ruby/lib/graphql/schema/field/scope_extension.rb
Lines 14 to 18 in b0d289e
This works when
scope_items
really did something, but not if you want to skip authorization altogether. For example, if you've got a list of items from an external service, and you want to return them as-is, without scoping or authorization, you'd have to do this:I bet there's a more robust way to implement this check (and maybe to implement the runtime metadata, too). I'm going to consider it for 3.0.
The text was updated successfully, but these errors were encountered: