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
When implementing the ability add GraphQL Scalars to a RedwoodJS applications GraphQL schema (see: redwoodjs/redwood#4053) I found that the error message provided when a scalar fails validation is a TypeError wrapped as the original error of the GraphQL error when using the envelopMasked Error plug-in.
Need to document the options for how best to handle errors and messages when using the Masked Errors plug-in.
You can allow the error have a message like:
Variable "$input" got invalid value "Roobles" at "input.currency_iso_4217"; Expected type "Currency". Value is not a valid currency value: Roobles
Or instead elect to use the original error message raised by the TypeError:
Value is not a valid currency value: Roobles
The former exposes field names (which is exactly what Masked Errors intends to prevent) while the latter is much more of a message that can be shared clients side in a HTML Form error message.
The text was updated successfully, but these errors were encountered:
When implementing the ability add GraphQL Scalars to a RedwoodJS applications GraphQL schema (see: redwoodjs/redwood#4053) I found that the error message provided when a scalar fails validation is a TypeError wrapped as the original error of the GraphQL error when using the envelop Masked Error plug-in.
Need to document the options for how best to handle errors and messages when using the Masked Errors plug-in.
You can allow the error have a message like:
Or instead elect to use the original error message raised by the TypeError:
The former exposes field names (which is exactly what Masked Errors intends to prevent) while the latter is much more of a message that can be shared clients side in a HTML Form error message.
The text was updated successfully, but these errors were encountered: