-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adds a predicate mechanism to compile a document into all variables or just some #2731
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
Conversation
…r just some This moves the Nadel fixes back in graphql-java world
|
|
||
| private static String getVarName(int variableOrdinal) { | ||
| return "v" + variableOrdinal; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I shortened the original work that Artyom put in as var_0 - I figure we should be as short as possible
gnawf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shit I never pressed submit yesterday
| * @return the map of variable names to variable values | ||
| */ | ||
| public Map<String, Object> getVariablesMap() { | ||
| return valueWithDefinitions.stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No immutable collections stuff?
| * The {@link ExecutableNormalizedOperationToAstCompiler} then uses all the variables when it compiles the final document. | ||
| */ | ||
| @Internal | ||
| public class VariableAccumulator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
| /** | ||
| * This predicate indicates whether a variable should be made for this field argument | ||
| */ | ||
| @Internal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal?
| @@ -0,0 +1,19 @@ | |||
| package graphql.schema.scalars; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be under the test module?
| @@ -0,0 +1,177 @@ | |||
| package graphql.schema.scalars; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, test module?
| // some values can be null (NullValue) and hence we can use Immutable Lists | ||
| return arrayValues.stream() | ||
| .map(ValueToVariableValueCompiler::toVariableValue) | ||
| .collect(toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you use FpKit?
This moves the Nadel fixes back in graphql-java world