我试图做一个RANGE_ADD
突变使用现在称为继电器经典(这可能是现代解决)。我得到的错误:突变没有请求在fatQuery上积极提取的容器数据RANGE_ADD
Warning: writeRelayUpdatePayload(): Expected response payload to include the newly created edge `newThingEdge` and its `node` field. Did you forget to update the `RANGE_ADD` mutation config?
所以,是的,有效载荷不发送任何的比预期的响应形状clientMutationId
更因为请求突变不是自讨苦吃。
根据@Joe Savona在这里,https://github.com/facebook/relay/issues/521,如果没有相交的容器请求这个数据,这可能会发生。但这对我来说并不完全正确。我Route
请求:
things: (Component) => Relay.QL`
query {
allThings(variable: $variable) {
${Component.getFragment('things')},
}
}
`,
,而我fatQuery正在请求:
fragment on AddMockThing {
allThings(variable: "${variable}", first: 100) {
edges {
node {
id,
},
},
},
newThingEdge
}
现在你可能会说这是不一样的疑问,因为在getFatQuery
版的额外first: 100
,但如果我不使用,我得到的错误:
Error: Error: You supplied the 'edges' field on a connection named 'allThings', but you did not supply an argument necessary to do so. Use either the 'find', 'first', or 'last' argument.
在另一方面,如果我的广告d first: 100
到Route
查询,我得到的错误:Error: Invalid root field 'allThings'; Relay only supports root fields with zero or one argument.
卡住fatQuery和困难的地方之间。将不胜感激的帮助!
感谢@steveluscher!在回到代码中使用您的建议(并替换我的解决方法)之前,我们只需要现在就承认它。 –