Versions
graphql 1.11.2
graphql-guard 2.0.0
Example Code
module Types
class PostType < Types::BaseObject
field :id, ID, null: false
field :name, String, null: true
field :masked_or_guarded_field, String, null: true, mask: -> (ctx) { !ctx[:current_user].is_admin?} # or, guard: -> (obj, args, ctx) { !ctx[:current_user].is_admin?}
end
end
Expected Response
{
"id": "1",
"name": "This is a name",
"masked_or_guarded_field": null, // or just not there at all
}
Actual Response
I've also tried it using this syntax with the same results:
field :masked_or_guarded_field, String, null: true do
mask: -> (ctx) { !ctx[:current_user].is_admin?} # or, guard: -> (obj, args, ctx) { !ctx[:current_user].is_admin?}
end
Let me know if I can provide any more information!
Versions
graphql 1.11.2
graphql-guard 2.0.0
Example Code
Expected Response
{ "id": "1", "name": "This is a name", "masked_or_guarded_field": null, // or just not there at all }Actual Response
nullI've also tried it using this syntax with the same results:
Let me know if I can provide any more information!