graphql

lxsli 2019-09-09T09:47:38.022700Z

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'."

lxsli 2019-09-12T11:47:35.025100Z

i is an OnboardCustomerInput which has a fullName field

lxsli 2019-09-12T11:48:09.025300Z

The commas are unimportant, you can use them or not

lxsli 2019-09-12T11:48:30.025500Z

Supplying the whole input object as a query var does work, but that is not the question

lxsli 2019-09-12T11:48:51.025700Z

Sorry I haven't checked in in a while!

lxsli 2019-09-12T11:49:58.025900Z

FWIW:

input OnboardCustomerInput {
  fullName: String!
  displayName: String!
  authLink: String
}

lxsli 2019-09-12T11:50:33.026200Z

[com.walmartlabs/lacinia "0.29.0-rc-1"]

gklijs 2019-09-09T10:33:54.023100Z

Why is the fullName in the json?

lxsli 2019-09-09T14:14:54.023500Z

Um, no JSON there? That's GraphQL syntax. I didn't include the query variables JSON as it doesn't make a difference.

lxsli 2019-09-09T14:15:31.023700Z

Backend is Lacinia btw.

hlship 2019-09-09T16:58:06.023900Z

What is the type of i? Should be an InputObject. Should have a fullName field. Gotta share the details if you expect a response.

1
timgilbert 2019-09-09T19:16:51.024200Z

I think you're also missing commas between eg "bob" and displayName:, FWIW.

timgilbert 2019-09-09T19:17:08.024400Z

For this type of thing I tend to write the query like mutation ($x: MyInputObject!) { onboardCustomer(i: $x) { commandId } }

timgilbert 2019-09-09T19:17:53.024600Z

...and then construct the $x parameter on the Clojure side rather than relying on an object literal in GraphQL syntax