-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Sometimes I have a form with not all fields required, and it will be used as inputs to a mutation.
const query = gql`
mutation myForm(
$name: String!
$tags: [String!]
) {
createSomethingAwesome(
name: $name
tags: $tags
) {
id
someField
}
`But I actually need to pass an empty tags to variables. If I pass only variables: { name } it will error.
Should apollo-client take care of this?
Right now I'm doing variables: { tags: [], ...formFields } instead of variables: formFields since formFields won't have tags key if it is empty.
lorensr and dcposch
Metadata
Metadata
Assignees
Labels
No labels