-
Notifications
You must be signed in to change notification settings - Fork 23
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
GQLGW-2564: Static Args Work #461
Conversation
actorFieldArg to staticValue | ||
} else { | ||
null | ||
} |
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.
if it ended up null - should it be a map of name to null?
Why does this makeNormalizedInputValue
methods return null is really the question - is it a I could not handle this
like can you do [{name: "someAttribute" value: null}]
say ??
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.
So looking into it, this function doesn't actually return null. This syntax was just a result of copying the ArgumentValue
case above. I will update now
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.
Why does this makeNormalizedInputValue methods return null is really the question
so the answer is actually it doesn't. Good catch!
@@ -72,7 +75,7 @@ object NadelDirectives { | |||
) | |||
.inputValueDefinition( | |||
name = "value", | |||
type = nonNull(GraphQLString), | |||
type = nonNull(ExtendedScalars.Json), |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Nah, this used to only have the options "$source.blah" or "$args.blah" which were always a string.
We only need it now because the static types could be other types (mentioned in description of PR)
// todo this should be a union or sealed class thing | ||
data class RemoteArgumentSource( | ||
val argumentName: String?, // for OBJECT_FIELD | ||
val pathToField: List<String>?, | ||
val sourceType: SourceType?, | ||
val staticValue: Value<*>?, |
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.
we dont have to do it for this PR - but I think this well become just astValue
when we do the mix or static or dynamic work later
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.
sounds good
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.
Left some comments, of which 99% of them should have a suggestion you can just commit directly to resolve.
Looking good.
lib/src/main/java/graphql/nadel/engine/transform/hydration/NadelHydrationInputBuilder.kt
Outdated
Show resolved
Hide resolved
lib/src/main/java/graphql/nadel/engine/blueprint/hydration/NadelHydrationActorInputDef.kt
Outdated
Show resolved
Hide resolved
lib/src/main/java/graphql/nadel/engine/blueprint/hydration/NadelHydrationActorInputDef.kt
Outdated
Show resolved
Hide resolved
lib/src/main/java/graphql/nadel/engine/blueprint/hydration/NadelHydrationActorInputDef.kt
Outdated
Show resolved
Hide resolved
lib/src/main/java/graphql/nadel/validation/NadelSchemaValidationError.kt
Outdated
Show resolved
Hide resolved
.../main/java/graphql/nadel/engine/transform/hydration/batch/NadelBatchHydrationInputBuilder.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Franklin Wang <[email protected]>
…onError.kt Co-authored-by: Franklin Wang <[email protected]>
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.
Looks good
NadelHydrationActorInputDef.ValueSource.StaticValue( | ||
value = remoteArgDef.remoteArgumentSource.staticValue!! | ||
) | ||
} |
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.
again later the naming here is likely to be AstArgument and NadelHydrationActorInputDef.ValueSource.AstValue
Hydrated input syntax is currently required to be passed as a variable (e.g $source.varName or $argument.varName). we want to implement static args, like so:
Note that this could be for many different types (e.g. String, Boolean, Int, Float, Array, Object).