apollographql / apollographql/fullstack-tutorial

Me Resolver on final is misleading

Open
#137 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
808
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the final `me` resolver shown in the issue and inspect how the resolver context is populated from authorization headers. Verify whether it should return `context.user` rather than call `dataSources.userAPI.findOrCreateUser()`; done means the resolver reports the authenticated user consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, authentication
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.