我正在尝试使用onChange
vue-apollo
但是出现以下错误:
let fields = [
{ name: 'A', value: '0' },
{ name: 'B', value: '' }
]
this.$apollo
.mutate({
mutation: gql`
mutation($serve: Int!, $fields: [ComponentInput]) {
visitCreate(serve: $serve, fields: $fields) {
id
...
}
}
`,
variables: {
serve: this.serve.id,
fields: fields
}
})
实际上Variable "$fields" got invalid value [{"name":"A","value":"0"},{"name":"B","value":null}]; Expected non-nullable type String! not to be null at value[1].value
应该是fields
,我不知道怎么做。
我也尝试过[{"name":"A","value":"0"},{"name":"B","value":""}]
请帮忙