Merged
Conversation
Still much to do
Member
Author
Introspection and better grammar plus GraphlXX runtime types
bbakerman
commented
Aug 29, 2020
bbakerman
commented
Aug 29, 2020
bbakerman
commented
Aug 30, 2020
| * @see DirectiveDefinition#isRepeatable() | ||
| */ | ||
| @PublicApi | ||
| public interface DirectivesContainer<T extends DirectivesContainer> extends Node<T> { |
Member
Author
There was a problem hiding this comment.
This method pattern is repeated in GraphqlDirectiveContainer as well - same names - same pattern - different types
This was referenced Aug 31, 2020
andimarek
reviewed
Sep 1, 2020
dugenkui03
reviewed
Sep 2, 2020
| public static Map<String, GraphQLDirective> directivesByName(List<GraphQLDirective> directiveList) { | ||
| return FpKit.getByName(directiveList, GraphQLDirective::getName, FpKit.mergeFirst()); | ||
|
|
||
| public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<GraphQLDirective> directives) { |
Contributor
There was a problem hiding this comment.
nonRepeatableDirectivesByName will travel directives three times. The code below seem to be faster:
public static Map<String, GraphQLDirective> nonRepeatableDirectivesByName(List<GraphQLDirective> directives) {
// filter the repeatable directives
List<GraphQLDirective> singletonDirectives = directives.stream()
.filter(d -> !d.isRepeatable()).collect(Collectors.toList());
return FpKit.getByName(singletonDirectives, GraphQLDirective::getName);
}| return true; | ||
| } | ||
|
|
||
| public static List<GraphQLDirective> enforceAdd(List<GraphQLDirective> targetList, GraphQLDirective newDirective) { |
Contributor
There was a problem hiding this comment.
Do you think this is an more efficient way to implement enforceAdd:
public static List<GraphQLDirective> enforceAdd(List<GraphQLDirective> targetList, GraphQLDirective newDirective) {
assertNotNull(targetList, () -> "directive list can't be null");
assertNotNull(newDirective, () -> "directive can't be null");
// check whether the newDirective is repeatable in advance, to avoid needless operations
if(newDirective.isNonRepeatable()){
Map<String, List<GraphQLDirective>> map = allDirectivesByName(targetList);
assertNonRepeatable(newDirective, map);
}
targetList.add(newDirective);
return targetList;
}…es-support # Conflicts: # src/main/java/graphql/DirectivesUtil.java # src/main/java/graphql/execution/ConditionalNodes.java # src/main/java/graphql/language/DirectiveDefinition.java # src/main/java/graphql/language/DirectivesContainer.java # src/main/java/graphql/language/InlineFragment.java # src/main/java/graphql/language/NodeUtil.java # src/main/java/graphql/language/SchemaDefinition.java # src/main/java/graphql/schema/GraphQLDirectiveContainer.java # src/main/java/graphql/schema/GraphQLEnumValueDefinition.java
Contributor
|
Need "isRepeatable" in |
bbakerman
commented
Oct 21, 2020
| testCompile 'org.openjdk.jmh:jmh-core:1.21' | ||
| testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.21' | ||
|
|
||
| testCompile 'is.tagomor.woothee:woothee-java:1.11.0' |
Member
Author
There was a problem hiding this comment.
This is some some rubbish left over testing - this is NOT needed
…es-support # Conflicts: # build.gradle # src/main/java/graphql/schema/idl/SchemaGenerator.java # src/main/java/graphql/schema/idl/SchemaGeneratorHelper.java not currently working
andimarek
requested changes
Nov 3, 2020
Member
andimarek
left a comment
There was a problem hiding this comment.
Great work overall!
See my comments.
…es-support # Conflicts: # src/main/java/graphql/schema/idl/SchemaGeneratorHelper.java # src/main/java/graphql/schema/idl/SchemaTypeChecker.java
…es-support # Conflicts: # src/main/java/graphql/language/Directive.java # src/main/java/graphql/language/DirectiveDefinition.java # src/main/java/graphql/language/InlineFragment.java # src/main/java/graphql/language/SchemaDefinition.java # src/main/java/graphql/schema/GraphQLArgument.java # src/main/java/graphql/schema/GraphQLDirective.java # src/main/java/graphql/schema/GraphQLEnumType.java # src/main/java/graphql/schema/GraphQLFieldDefinition.java # src/main/java/graphql/schema/GraphQLInputObjectField.java # src/main/java/graphql/schema/GraphQLInputObjectType.java # src/main/java/graphql/schema/GraphQLObjectType.java # src/main/java/graphql/schema/GraphQLScalarType.java # src/main/java/graphql/schema/GraphQLSchema.java # src/main/java/graphql/schema/GraphQLUnionType.java
andimarek
approved these changes
Nov 15, 2020
…es-support # Conflicts: # src/main/java/graphql/schema/GraphQLUnionType.java # src/main/java/graphql/schema/idl/SchemaGeneratorHelper.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a starting branch on repeatable directives.
https://github.com/graphql/graphql-spec/pull/472/files
It supersedes the other PRs however code from them has been incorporated (via copy paste not commits) so we are grateful for those contributions
We have