-
-
Notifications
You must be signed in to change notification settings - Fork 917
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
Support for repeatable directives, refactored schema visitors (stateless), directives validation, small optimizations #2247
Conversation
…ateless), directives validation, small optimizations
@Shane32 This PR is relatively simple. It develops ideas for which the preparatory work has already been done earlier - here, in parser repo, spec repo. |
I did not make edits in the migration guide so as not to generate conflicts. |
@@ -52,7 +52,7 @@ private class TraitsDirective : DirectiveGraphType | |||
public override bool? Introspectable => true; | |||
|
|||
public TraitsDirective() | |||
: base("traits", DirectiveLocation.Schema | DirectiveLocation.Object | DirectiveLocation.FieldDefinition) |
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.Throw<ArgumentOutOfRangeException>(() => new EnumerationGraphType<Invalid>()); | ||
public void AddValue_whenEnumContainsInvalidCharacters_shouldThrowArgumentException() | ||
{ | ||
// race condition with does_not_throw_with_filtering_nameconverter test |
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.
one more test for invalid names
|
||
private DirectiveLocation ToDirectiveLocation(string name) | ||
{ | ||
var enums = new __DirectiveLocation(); //TODO: remove new, also see TODO above |
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.
No more alocations here and above. Two TODOs are done.
I appreciate the thought, but it would actually be better if you added the notes so I have something to work from. I’ll handle the merge. Or add some notes in the PR of the migration guide so I don’t forget anything. |
I’m not at a pc now but I noticed a lot of references to Schema instead of ISchema. Unless the class is only used by the schema builder, I would expect that it should be ISchema. Can we change that? |
Done. I myself will write on a separate documentation page everything that is done with the directives. I will also make one or more PRs with documentation and examples. Directives are the area that is required in my work, so I considered it right to finish what I have long wanted. |
Thank you!!! |
This is a continuation of working with directives. Fixes #1496.