Is your feature request related to a problem? Please describe.
When a field callback fails, the error is always caught.
However, in some scenarios, you want such an error to bubble up and fail the whole document creation.
optional in a field schema, means optional from the user standpoint, eg in forms or hooks.
However, sometimes, you want some data to be optional from the user standpoint, but you expect the creation process to succeed server-side via callbacks
We would need another option, like validateCallbacks that rethrows the error. OR we could reverse the current behaviour, throw as a default, and provide a dontFailOnCallbackError flag for instance.
Additional context
This was for example used in file upload in vulcan meteor.
Is your feature request related to a problem? Please describe.
When a field callback fails, the error is always caught. However, in some scenarios, you want such an error to bubble up and fail the whole document creation.
Describe the solution you'd like
https://github.com/VulcanJS/vulcan-npm/blob/main/packages/graphql/server/resolvers/mutators.ts#L318
Describe alternatives you've considered
optional
in a field schema, means optional from the user standpoint, eg in forms or hooks.validateCallbacks
that rethrows the error. OR we could reverse the current behaviour, throw as a default, and provide adontFailOnCallbackError
flag for instance.Additional context This was for example used in file upload in vulcan meteor.