-
-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publicly expose ability to register an error type on a mutation field #6308
Publicly expose ability to register an error type on a mutation field #6308
Conversation
This might've been what you were alluding to @michaelstaib when we last spoke. Exposing this to libraries. Assuming it is, just need to address the todo in there and then this could be merged. I don't think I'll back port this to v12. |
|
||
if (descriptorContext.ContextData[MutationContextDataKeys.Options] == null) | ||
{ | ||
throw new Exception("Mutation convention isn't turned on"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a SchemaException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be OK now
Can you add a test that shows this in action? |
Thanks for the review. Will get back to this when I can |
Hey @michaelstaib, test added and schema exception used (with a resource-file based msg). |
...__snapshots__/AnnotationBasedMutations.SimpleMutation_Add_Error_Via_Type_Interceptor.graphql
Show resolved
Hide resolved
Thanks for this one mate :) |
Was this merged into the correct branch? |
Allows libraries to register their own error types in type interceptors (if they can tap in early enough)