Skip to content
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

Some tuto steps missing ? #80

Open
Totone opened this issue Dec 7, 2020 · 2 comments
Open

Some tuto steps missing ? #80

Totone opened this issue Dec 7, 2020 · 2 comments

Comments

@Totone
Copy link

Totone commented Dec 7, 2020

Hi, & first thanks for this tuto, really helpful to learn GraphQL
I'm facing an understanding issue.

I finished chapter "Connecting The Server and Database with Prisma Client" & started the following "Realtime GraphQL Subscriptions"

In this new chapter, context is defined like this:

const server = new ApolloServer({
  typeDefs: fs.readFileSync(
    path.join(__dirname, 'schema.graphql'),
    'utf8'
  ),
  resolvers,
  context: ({ req }) => {
    return {
      ...req,
      prisma,
      pubsub
      userId:
        req && req.headers.authorization
          ? getUserId(req)
          : null
    };
  }
});

But in the previous chapter, context was just an object which stored prisma instance.
A funny thing is that it's written Now, in the same file, add pubsub to the context, just as did with prisma: but I didn't do like this at all with prisma.

As well, the tuto invites us to create a new file in resolver/ folder. If I can understand why a modular structure, I'm sure that this folder hasn't been created yet.

Is there a step missing ?

@swap1789
Copy link

Right, even i cannot find tutorials about authentication - User model, resolver etc. Please update.

Thanks

@remuspoienar
Copy link

i came across part 6 in google when searching some auth tutorials on graphql. This is the link

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

No branches or pull requests

3 participants