graphql-devise / graphql_devise

GraphQL interface on top devise_token_auth
MIT License
200 stars 39 forks source link

`context[:controller]` is nil when trying to login #246

Closed benkovy closed 1 year ago

benkovy commented 1 year ago

Question

This is likely to do with my setup but it is basically a fresh rails application where I added the graphql gem set up a schema and then added the graphql_devise gem as well.

When I fire the login mutation I am running into an error.

undefined methodresource=' for nil:NilClass`

coming from this line in the ControllerMethods concern.

Is there are reason why the context[:controller] would be nil? I cannot seem to find where this is set in the first place.

Thanks!

benkovy commented 1 year ago

solved 🤦

don't forget to add the gql_devise_context(User) to your schema context!!