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
Thanks for giving that tip on ctx.add_error in the referenced issue. I'm wondering if it's possible to add an error for a subfield/argument?
For example in case of multiple validation errors, in the field's resolve function I would like to add an error that that the argument item_no was out of bounds, and the argument commission cannot be set if the commission_type is not set.
ctx.add_error would return the query in the fields field of the error, whereas it would be much more self-explanatory (and easier for the frontend), if it were the erroneous argument, so it would not need a complex decision logic to show it to the user.
I'm thinking something like ctx.get_context_for(:item_no).add_error(...)
The text was updated successfully, but these errors were encountered:
Related to #629:
Thanks for giving that tip on
ctx.add_error
in the referenced issue. I'm wondering if it's possible to add an error for a subfield/argument?For example in case of multiple validation errors, in the field's resolve function I would like to add an error that that the argument
item_no
was out of bounds, and the argumentcommission
cannot be set if thecommission_type
is not set.ctx.add_error
would return the query in thefields
field of the error, whereas it would be much more self-explanatory (and easier for the frontend), if it were the erroneous argument, so it would not need a complex decision logic to show it to the user.I'm thinking something like
ctx.get_context_for(:item_no).add_error(...)
The text was updated successfully, but these errors were encountered: