Is it possible to authenticate non-root fields?
After some hurdles I managed to set this gem up with graphql 2.0.14. I got to the point where I set authenticate_default: false in my main schema and if I set authenticate: true on one of the root fields in QueryType I'm getting an error if I want to access it while not being authenticated. However if I add authenticate: true to one of the non-root fields it doesn't seem to have any effect.
In my case I have:
# ./app/graphql/types/photo_type.rb
module Types
class PhotoType < GraphQL::Schema::Object
field_class GraphqlDevise::Types::BaseField
description 'A Photo'
field :id, String, null: false, authenticate: true
[ snip ]
end
end
I can access id without being authenticated.
Is it possible to have this type of granular authentication? If yes, what am I doing wrong?
Is it possible to authenticate non-root fields?
After some hurdles I managed to set this gem up with graphql 2.0.14. I got to the point where I set
authenticate_default: falsein my main schema and if I setauthenticate: trueon one of the root fields in QueryType I'm getting an error if I want to access it while not being authenticated. However if I addauthenticate: trueto one of the non-root fields it doesn't seem to have any effect.In my case I have:
I can access id without being authenticated.
Is it possible to have this type of granular authentication? If yes, what am I doing wrong?