在我的 React 应用程序中,我尝试使用Relay通过 id获取文档 ( artwork
),但出现错误:
Invariant Violation: printRelayOSSQuery(): Expected an argument name for root field `artwork`.
我使用graffiti-mongoose作为服务器,我的路由基于示例 Relay 代码,来源如下:
class SubmittedArtworkRoute extends Relay.Route {
static queries = {
artwork: (Component) => Relay.QL`
query {
artwork(id: $id) {
${Component.getFragment('artwork')}
}
}
`,
};
static paramDefinitions = {
id: {required: true},
};
static routeName = 'SubmittedArtworkRoute';
}
我错过了什么?