mutation ($DisplayName: String!, $AuthLink: String) {
onboardCustomer(i: {
fullName: "Bob"
displayName: $DisplayName
authLink: $AuthLink
}) {
commandId
}
}
Is this supposed to work? Seems a reasonable thing to do but it doesn't. Weirdly the error is:
"Exception applying arguments to field 'onboardCustomer': For argument 'i', unknown argument 'fullName'."
i
is an OnboardCustomerInput which has a fullName
field
The commas are unimportant, you can use them or not
Supplying the whole input object as a query var does work, but that is not the question
Sorry I haven't checked in in a while!
FWIW:
input OnboardCustomerInput {
fullName: String!
displayName: String!
authLink: String
}
[com.walmartlabs/lacinia "0.29.0-rc-1"]
Why is the fullName in the json?
Um, no JSON there? That's GraphQL syntax. I didn't include the query variables JSON as it doesn't make a difference.
Backend is Lacinia btw.
What is the type of i? Should be an InputObject. Should have a fullName field. Gotta share the details if you expect a response.
I think you're also missing commas between eg "bob"
and displayName:
, FWIW.
For this type of thing I tend to write the query like mutation ($x: MyInputObject!) { onboardCustomer(i: $x) { commandId } }
...and then construct the $x
parameter on the Clojure side rather than relying on an object literal in GraphQL syntax