graphql_devise icon indicating copy to clipboard operation
graphql_devise copied to clipboard

how to set current_resource for both authenticated and unauthenticated fields

Open NathanielAwoke opened this issue 3 years ago • 1 comments

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.

NathanielAwoke avatar May 28 '22 09:05 NathanielAwoke

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?

00dav00 avatar May 31 '22 11:05 00dav00