VulcanJS / vulcan-npm

The full-stack JavaScript App Framework
https://vulcan-docs.vercel.app
MIT License
31 stars 8 forks source link

Mutator should allow rethrowing errors in "onCreate", "onUpdate" callbacks for server generated fields #109

Open eric-burel opened 2 years ago

eric-burel commented 2 years ago

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

Additional context This was for example used in file upload in vulcan meteor.