You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
Description
Under this issue, we try to explore the behavior of client in error conditions. There is also a broad proposal prisma/prisma#2199 that also applies to Prisma client
We will explore network errors and GraphQL errors separately. Note that GraphQL errors can also be partial i.e. both data and errors can be filled by the server.
Network error
Assuming that the service is down. Running an operation on Client throws, which IMO is the correct behavior.
This code throws in case an exception with the following trace:-
{ Error: Project not found: 'client-errors@dev'
at BatchedGraphQLClient.<anonymous> (/Users/divyendusingh/Documents/projects/graphcool/triage/client-errors/node_modules/http-link-dataloader/src/BatchedGraphQLClient.ts:59:13)
at step (/Users/divyendusingh/Documents/projects/graphcool/triage/client-errors/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:40:23)
at Object.next (/Users/divyendusingh/Documents/projects/graphcool/triage/client-errors/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:21:53)
at fulfilled (/Users/divyendusingh/Documents/projects/graphcool/triage/client-errors/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:12:58)
at process._tickCallback (internal/process/next_tick.js:68:7) result: { errors: [ [Object] ], status: 200 } }
GraphQL Errors
On running a Client operation that is sure to produce invalid GraphQL i.e. yielding filled errors key in response from server.
try {
const users = await prisma.users().$fragment(`fragment userData on User { nonExistingField }`)
console.log(users);
} catch (e) {
console.error(e);
}
This also throws, which might not be the correct behavior because GraphQL errors can also be partial i.e. both data and errors can be filled by the server. Even if this is a preferred client behavior, it should be documented here: prisma/prisma#3185
Versions (please complete the following information):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
Under this issue, we try to explore the behavior of client in error conditions. There is also a broad proposal prisma/prisma#2199 that also applies to Prisma client
We will explore network errors and GraphQL errors separately. Note that GraphQL errors can also be partial i.e. both
data
anderrors
can be filled by the server.Network error
Assuming that the service is down. Running an operation on Client throws, which IMO is the correct behavior.
This code throws in case an exception with the following trace:-
GraphQL Errors
On running a Client operation that is sure to produce invalid GraphQL i.e. yielding filled
errors
key in response from server.This also throws, which might not be the correct behavior because GraphQL errors can also be partial i.e. both
data
anderrors
can be filled by the server. Even if this is a preferred client behavior, it should be documented here: prisma/prisma#3185Versions (please complete the following information):
prisma
CLI:prisma/1.19.0-beta.2 (darwin-x64) node-v10.4.0
The text was updated successfully, but these errors were encountered: