Hi all, I created a prisma service using the types...
# orm-help
m
Hi all, I created a prisma service using the typescript boilerplate and included middlewhere in it like so:
Copy code
const getUser = async (resolve, root, args, context, info) => {
  //context.user = await userServiceBinding.query.authenticateUser(context);
  console.log("first middlewhere called");
  const result = await resolve(root, args, context, info)
  console.log("second middlewhere called");
  return null;
}
const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers,
  middlewares: [getUser],
  context: req => ({
    ...req,
    db: new Prisma({
      endpoint: '<https://eu1.prisma.sh/twigbit/vos_objectservice/dev>', // the endpoint of the Prisma API
      debug: true, // log all GraphQL queries & mutations sent to the Prisma API
      // secret: 'mysecret123', // only needed if specified in `database/prisma.yml`
    }),
  }),
})
server.start(() => console.log('Server is running on <http://localhost:4000'>))
However, when I start the server using
yarn dev
, the middlewhere is called a lot without me fireing any queries or mutations against the server (console output: )
Copy code
first middlewhere called
first middlewhere called
first middlewhere called
first middlewhere called
first middlewhere called
second middlewhere called
second middlewhere called
second middlewhere called
second middlewhere called
second middlewhere called
Any ideas why this might be happening?
n
This seems to be an unexpected issue, can you provide a reproduction here: https://github.com/prismagraphql/graphql-middleware/issues/22?
Also your message fills an entire screen, that's probably a sign that Slack is not the right place to post it 😄
m
Sorry for the clutter 🙂 I posted my issue in the suggested location. Thanks for the quick reply!
🙌 1
n
awesome, thanks for sharing the repro!