问题描述
我正在尝试创建一个 graphql 突变以使用其他对象的数组更新对象字段。这是我的架构:
"url":
post:
summary: Saves user properties
operationId: saveProperties
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: request
description: request
required: true
schema:
"$ref": "#/deFinitions/SavePropertiesDto"
originalRef: SavePropertiesDto
SavePropertiesDto:
type: object
required:
- saveProperties
properties:
saveProperties:
type: array
items:
"$ref": "#/deFinitions/SavePropertyDto"
originalRef: SavePropertyDto
SavePropertyDto:
type: object
required:
- agree
- Id
properties:
agree:
type: boolean
Id:
type: string
title: SavePropertyDto
mutation someFunc($requestBody: [SavePropertyInput!]) {
saveProperties(requestBody: $requestBody) {
agree
Id
}
我收到错误
Field \"saveProperties\" must not have a selection since type \"JSON\" has no subfields
当我执行此请求时。此外,我不等待对此查询的响应,而只等待 204 代码。据我了解,我需要将 SavePropertyInput 作为变量传递给查询请求。抱歉,我使用 yml 格式的数据。提前致谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)