| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
|
||
| import java.util.function.Predicate; | ||
|
|
||
| public class QueryGeneratorOptions { |
There was a problem hiding this comment.
@Expimental
Sorry, something went wrong.
| this.filterFieldDefinitionPredicate = filterFieldDefinitionPredicate; | ||
| } | ||
|
|
||
| public int getMaxFieldCount() { |
There was a problem hiding this comment.
java doc
Sorry, something went wrong.
| return maxFieldCount; | ||
| } | ||
|
|
||
| public Predicate<GraphQLFieldsContainer> getFilterFieldContainerPredicate() { |
There was a problem hiding this comment.
java doc
Sorry, something went wrong.
| import java.util.concurrent.atomic.AtomicInteger; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class QueryGeneratorFieldSelection { |
There was a problem hiding this comment.
@ExperimentlApi
Sorry, something went wrong.
| 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
Sorry, something went wrong.
| @@ -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?
Sorry, something went wrong.
|
Thanks @bbakerman and @dondonz I addressed your comments. |
Sorry, something went wrong.
| 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
Sorry, something went wrong.
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?
Sorry, something went wrong.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the PR!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.graphql file contains an example of a generated query for a somewhat complex type.
Let me know what y'all think!