No Node for the model User with value 5c87b80efec496584da9fbf3 for id found


I am getting the error but it is not descriptive, the user exists in the database, there is my code:


    purchase: String!
    address: String!
    comments: String!
    serviceDate: String!
): Purchase


async function createPurchase(root, args, context) {
      const userID = getUserId(context);
      console.log("CREATEPURCHASE", userID);
      if (!userID) {
        throw new Error("Not authenticated");
      const createdAt = new Date();
        return await context.prisma.createPurchase({
          user: { connect: { id: userID } },
          purchase: args.purchase,
          address: args.address,
          comments: args.comments,
          serviceDate: args.serviceDate


      type Purchase {
        id: ID! @id
        user: User! @relation(link: INLINE)
        professional: String
        purchase: String!
        comments: String
        address: String!
        serviceDate: DateTime
        createdAt: DateTime!
        ended: Boolean @default(value: false)

  type User {
    id: ID! @id
    name: String!
    email: String! @unique
    phone: String
    secretop: String!
    avatar: String
    createdAt: DateTime!
    purchases: [Purchase]
    pushtoken: String
    role: String @default(value: "user")
    location: Json
    recover_code: String
    verify_code: String
    active: Boolean @default(value: true)

for me, the error is not clear.


Hey, can you please also post your docker-compose.yml?



version: '3'
    image: prismagraphql/prisma:1.26
    restart: always
    - "4466:4466"
        port: 4466
        # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret
            connector: mongo
            uri: >-


Can you update your Prisma version to 1.28.3 and quickly check whether the error is still there. We had a fix for Mongo since then and I just want to be sure this did not already cover it.


Still the same, I’ve already updated the Prisma, restarted the docker, restarted the pm2 and run again the mutation with no success.


Ok, then I’ll look into it.


Would you please explain the error message, it happens because… maybe if i understand the error i can get a light.


Well the error message states that Prisma was trying to do the connect with the Information you provided. It was looking for a User with the id 5c… but could not find it. Then it errors.

I tried reproducing the problem locally, but for me it worked.

Could you run docker ps in the terminal and post the output please?


weird, because I look with that same id, and the user exists, here is the

docker ps

CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                    NAMES
    9b6503010bb2        prismagraphql/prisma:1.28.3   "/bin/sh -c /app/sta…"   16 minutes ago      Up 15 minutes>4466/tcp   backend_prisma_1


@epileftro85 Can you please dump the data in your database using prisma export and share that here or find me in our slack at, my username there is divyenduz.


Export is not yet supported for document stores.

i will give you a repo if you want to look at it


I am more interested in seeing the actual data in the underlying database. Can you provide me temporary access to the database itself?

Does a normal query on user with this id return the data correctly?


Which way should I send to you the exported data?

#14 or join our slack at


Sent to email. Thank you in advance.



I am unable to reproduce this. I even restored the export you have sent to @Divyendu_Singh


I am using prisma version 1.28.3. I am using the following script to reproduce:

const { prisma } = require('./generated/prisma-client')

async function main() {
  let test = await prisma.createPurchase({
    user: { connect: { id: '5c87b80efec496584da9fbf3' } },
    purchase: 'asd',
    address: 'asd',
    comments: 'asd',
    createdAt: new Date().toISOString(),
    serviceDate: new Date().toISOString(),




Thanks for your time, I will keep looking what would be if I find something I will update the answer. :+1:


Hi All, it was my bad, turns out that I am mixing mongoose on the user creation because I need to use geoLocation, and Prisma is not ready yet to GeoJson Objects ( according to the docs ), so, my document was named users instead User. That was why the Prisma was not founding any user with the id. Thank you all for your time, and sorry for the false alarm. @pantharshit00 @Divyendu_Singh @do4gr


Thanks for informing us. Happy that it worked out for you.


This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.