Skip to content

Some tuto steps missing ? #80

@Totone

Description

@Totone

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions