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
Is your feature request related to a problem? Please describe.
Currently, if one of the GraphQL documents loaded via loadDocuments is invalid (e.g. raises a parse error), a single GraphQLError instance is thrown.
However, it might be useful to sometimes have:
access to all the failed parsing errors
access to the successfully parsed documents and the failed parsed documents
Describe the solution you'd like
Introduce different "load error behaviors" that alter the error handling. This could be done by a property that is passed to the loadDocuments function.
Raise first error as it happens (current behaviour)
constdocuments=awaitloadDocuments(['packages/**/*.graphql','packages/**/*.ts(x)'],{loaders: [newGraphQLFileLoader(),newCodeFileLoader()],errorBehaviour: 'legacy'// !!! better name recommendations welcome!!!});
Do not raise an error at all, but instead include error in the return result
constdocuments=awaitloadDocuments(['packages/**/*.graphql','packages/**/*.ts(x)'],{loaders: [newGraphQLFileLoader(),newCodeFileLoader()],errorBehaviour: 'ignore'});documents[0].document// this is null documents[0].error// this is a GraphQLError
Describe alternatives you've considered
So far there is no alternative solution except re-implementing the function from scratch for each use case.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, if one of the GraphQL documents loaded via
loadDocuments
is invalid (e.g. raises a parse error), a singleGraphQLError
instance is thrown.However, it might be useful to sometimes have:
Describe the solution you'd like
Introduce different "load error behaviors" that alter the error handling. This could be done by a property that is passed to the
loadDocuments
function.Raise first error as it happens (current behaviour)
Raise all errors as AggregateError
Do not raise an error at all, but instead include error in the return result
Describe alternatives you've considered
So far there is no alternative solution except re-implementing the function from scratch for each use case.
The text was updated successfully, but these errors were encountered: