-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically adding user to graphql resolver context #421
Comments
This sounds like a good improvement to me. |
Is resume session as in the code above the best way to do this? |
I think so. After this change do you think the |
I'm not sure I follow why it wouldn't be needed.
If the client wants to get information about the current user, getuser
would still be the way to do it, no?
…On Wed, 1 Aug 2018, 21:01 Tim Mikeladze, ***@***.***> wrote:
I think so. After this change do you think the getUser query is still
needed? Or perhaps it could be modified to return context.user if it
exists?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#421 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC8oX42gJ3gl0qb3Y_zB3Z1rQRIof3wtks5uMezxgaJpZM4Vm55g>
.
|
Yeah sorry I worded that incorrectly. I meant to say that it should be modified to use |
@elie222 was wondering does throwing inside the context function create a formatted graphql error? |
AFAICT, the current behavior is that whenever there's a valid access token stored on the client, it's included in a header, and |
Are you sure about that? Will need to check again. I had to add that
functionality myself because I didn't see it already included. I just the
ip and access token sent on with no user object.
…On Sat, 4 Aug 2018, 06:15 Loren
|
I just submitted a pull request for that #437 |
I see the code has
authenticated
as shown here:Would it make sense to just add authenticated to the context and have the
user
object available for every request made to the server?Right now I have this in my code:
Seems something like this would be useful for all users of the
graphql-api
package. Would it make sense to haveaccountsContext
also return the user object if it exists.The text was updated successfully, but these errors were encountered: