Conversation
|
|
||
| import java.util.function.Predicate; | ||
|
|
||
| public class QueryGeneratorOptions { |
| this.filterFieldDefinitionPredicate = filterFieldDefinitionPredicate; | ||
| } | ||
|
|
||
| public int getMaxFieldCount() { |
| return maxFieldCount; | ||
| } | ||
|
|
||
| public Predicate<GraphQLFieldsContainer> getFilterFieldContainerPredicate() { |
| import java.util.concurrent.atomic.AtomicInteger; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class QueryGeneratorFieldSelection { |
| public String generateQuery( | ||
| String operationFieldPath, | ||
| @Nullable String operationName, | ||
| @Nullable String arguments, |
There was a problem hiding this comment.
javadoc
I am unsure what arguments and typeClassifier mean
| @@ -0,0 +1,82 @@ | |||
| package graphql.util.querygenerator; | |||
|
|
|||
| import com.google.common.base.Predicates; | |||
There was a problem hiding this comment.
We have a checker in the build to look for new Guava imports, and we prefer to not add new imports.
Is it possible to use the plain Java version of this instead?
|
Thanks @bbakerman and @dondonz I addressed your comments. |
| import graphql.schema.GraphQLSchema; | ||
| import graphql.schema.GraphQLUnionType; | ||
|
|
||
| import javax.annotation.Nullable; |
There was a problem hiding this comment.
Small one: could you change this to be the JSpecify Nullable annotation, rather than javax?
I'll amend the ArchUnit test so this gets automatically picked up in future
There was a problem hiding this comment.
Done ;-)
Out of curiosity: what's the advantage of the JSpecify version of Nullable when compared to the native one?
There was a problem hiding this comment.
Yep good question, it is only an annotation at the end of the day so there isn't inherently something "new" about JSpecify's "implementation", but the advantage is that it has become a standard because all the big industry players are behind it. For example, Spring have formally adopted it, even at work JSpecify (& NullAway) will soon become a standard.
A little utility function that allows people to generate queries for a certain type.
This will be useful for a use case I'm working on at the moment, where I need to generate test queries that contain as many fields as possible.
The
generated-query-for-extra-large-schema-1.graphqlfile contains an example of a generated query for a somewhat complex type.Let me know what y'all think!