Skip to content

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

@kohakade

Description

@kohakade

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.

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