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

Calling multiple prisma requests returns same error to all the request if any one of them gives error. #380

Open
kohakade opened this issue Apr 23, 2019 · 0 comments

Comments

@kohakade
Copy link

When called multiple requests (Query/Mutation) to Prisma server using Promise.all, if Any one of the request gives an error like unique constraints violation the all other request stops and gives the same error even though some request are queries.

{ Error: A unique constraint would be violated on *****. Details: Field name = *****
    at BatchedGraphQLClient.<anonymous> (/*****/server/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:77:35)
    at step (/*****/server/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:40:23)
    at Object.next (/*****/server/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:21:53)
    at fulfilled (/*****/server/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:12:58)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
  message: 'A unique constraint would be violated on *****. Details: Field name = *****',
  locations: [],
  path: [ '*****' ] }

I want to perform bulk create operation and want to perform opeartion for all even if any of them gives validation error and return summary like number successfully created, error, etc.

I also saw that some request have completed and new records are added into db but due to this isssue all records return same error.

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

1 participant