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

Support for repeatable directives, refactored schema visitors (stateless), directives validation, small optimizations #2247

Merged
merged 5 commits into from
Feb 2, 2021

Conversation

sungam3r
Copy link
Member

@sungam3r sungam3r commented Feb 1, 2021

This is a continuation of working with directives. Fixes #1496.

…ateless), directives validation, small optimizations
@sungam3r sungam3r requested a review from Shane32 February 1, 2021 22:10
@github-actions github-actions bot added the test Pull request that adds new or changes existing tests label Feb 1, 2021
@sungam3r sungam3r linked an issue Feb 1, 2021 that may be closed by this pull request
@sungam3r
Copy link
Member Author

sungam3r commented Feb 1, 2021

@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.

@sungam3r
Copy link
Member Author

sungam3r commented Feb 1, 2021

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

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
Copy link
Member Author

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
Copy link
Member Author

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.

@Shane32
Copy link
Member

Shane32 commented Feb 2, 2021

I did not make edits in the migration guide so as not to generate conflicts.

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.

@Shane32
Copy link
Member

Shane32 commented Feb 2, 2021

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?

@sungam3r
Copy link
Member Author

sungam3r commented Feb 2, 2021

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.

@github-actions github-actions bot added the documentation An issue or pull request regarding documentation improvements label Feb 2, 2021
@Shane32
Copy link
Member

Shane32 commented Feb 2, 2021

Thank you!!!

@sungam3r sungam3r merged commit 8e6defd into develop Feb 2, 2021
@sungam3r sungam3r deleted the location branch February 2, 2021 17:38
@sungam3r sungam3r added this to the 4.0 milestone Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or pull request regarding documentation improvements test Pull request that adds new or changes existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for repeatable directives
2 participants