Conversation
| .field(newFieldDefinition() | ||
| .name("name") | ||
| .type(GraphQLString)) | ||
| .type(nonNull(GraphQLString))) |
| String directiveName = directive.getName(); | ||
| GraphQLDirective graphQLDirective = getValidationContext().getSchema().getDirective(directiveName); | ||
|
|
||
| if (graphQLDirective == null) continue; |
There was a problem hiding this comment.
please use fully formed if statements
if (graphQLDirective == null) {
continue;
}
more lines : yes - more readable : also yes
There was a problem hiding this comment.
by using the GraphQL java code formatter it will be automatically handled.
| GraphQLDirective graphQLDirective = getValidationContext().getSchema().getDirective(directiveName); | ||
|
|
||
| if (graphQLDirective == null) continue; | ||
| if (graphQLDirective.getDefinition() != null && graphQLDirective.getDefinition().isRepeatable()) continue; |
There was a problem hiding this comment.
I think we will want to transfer the AST isRepeatable into the runtime GraphQLDirective class.
That is inside SchemaGenerator related code we transfer these booleans over
The AST elements are for reading SDL - the GraphqlXXX class are aimed as the runtime equivalents with more logic in them and more state rules.
There was a problem hiding this comment.
thanks for your guidance
|
This is start to the repeatable directives. However it only handles "queries" and not the type system Its valid to do this So we would need repeatable directives to go into the GraphqlXXX types as well. The challenge here is that while they expose
These would need to be fixed up - thank good we made it a list and not a map to the outside world phew |
|
Thanks for this work. In order to collaborate on this (where we can add code and so could you) I am going to close this PR and use a long lived branch See #1916 branch : Please make any future PRs against that branch and we can collaboratively get this up |
|
Again this code so far is pretty good and a great start - its just that it need to be the full support to make it into the master and we may work on improving that as well outselves |
thanks |
#1763
Add repeatable directives;
change the
UniqueDirectiveNamesPerLocationto ignore repeatable directive;change the
Introspectionto follow the spec: