Skip to content
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

Merged
merged 5 commits into from
Jul 30, 2023

Conversation

benmccallum
Copy link
Collaborator

Allows libraries to register their own error types in type interceptors (if they can tap in early enough)

@benmccallum
Copy link
Collaborator Author

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");
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be OK now

@michaelstaib
Copy link
Member

Can you add a test that shows this in action?

@benmccallum
Copy link
Collaborator Author

Thanks for the review. Will get back to this when I can

@benmccallum
Copy link
Collaborator Author

Hey @michaelstaib, test added and schema exception used (with a resource-file based msg).

@benmccallum benmccallum requested a review from michaelstaib July 29, 2023 00:52
@benmccallum benmccallum requested a review from glen-84 July 29, 2023 01:09
@michaelstaib
Copy link
Member

Thanks for this one mate :)

@michaelstaib michaelstaib merged commit 14fc383 into main-version-13 Jul 30, 2023
@michaelstaib michaelstaib deleted the benmc/mutation-conventions-add-error branch July 30, 2023 21:37
@glen-84
Copy link
Collaborator

glen-84 commented Jul 31, 2023

Was this merged into the correct branch?

@glen-84
Copy link
Collaborator

glen-84 commented Aug 3, 2023

@michaelstaib @benmccallum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants