Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Me Resolver on final is misleading #137

Open
davicatunda opened this issue Apr 30, 2020 · 1 comment
Open

Me Resolver on final is misleading #137

davicatunda opened this issue Apr 30, 2020 · 1 comment

Comments

@davicatunda
Copy link

This is the resolver for me on final

me: async (_, __, { dataSources }) =>
      dataSources.userAPI.findOrCreateUser(),

However it could (and probably should) be

me: async (_, __, context) => context.user

which is the logged in user authenticated by the authorization headers.

@dylan-cm
Copy link

you might be right. However, I do want to point out that the UserAPI.findOrCreateUser method, checks for a user on the context when it is called without the email argument. Not sure one solution is better than the other.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants