fs / fs/rails-base-graphql-api

Need to provide authenticated user to context in SignIn and SignUp mutation

Open
#222 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
26
Forks
6
PR merge metrics
No merged PRs in 30d

Description

This error can be reproduced if you request additional policy rules for the user when logging in

```suggestion
module Mutations
class SignIn < BaseMutation
argument :input, Types::SignInInput, required: true

type Types::Payloads::SignInPayload

def resolve(input:)
signin_user = SigninUser.call(input.to_h)

if signin_user.success?
context[:current_user] = result.user

signin_user
else
execution_error(error_data: signin_user.error_data)
end
end
end
end
```

co-authored @AnnaAleynik

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.