graphql_devise
graphql_devise copied to clipboard
how to set current_resource for both authenticated and unauthenticated fields
Question
current_resource is set only when the field is defined as an authenticated field, is there any way to set the current_resource for unauthenticated fields also, given the proper auth headers are set in the request ?
field :listings, Types::ListingType, authenticate: true -> current resource is accessible here
field :listings, Types::ListingType, authenticate: false -> current resource is not available, even though the proper headers are set in the request.
Hi @NathanielAwoke , have you checked if this method is reached?
You need to make sure that the controller you are using includes this concern so gql devise can use DTA to set the user by token.
I'm curious about the use case you are dealing with here. Do you mind expanding a little bit more on your idea?