【发布时间】:2021-11-18 02:19:37
【问题描述】:
我正在尝试编译 Relay,但它没有将我的 graphql 查询识别为有效。
示例查询:
const testQuery = graphql`query CustomersQuery {
customers(first: 20) {
nodes {
id
name
}
}
}`
该项目在 CRA 2.0 上使用 Typescript。
构建脚本如下:
"relay": "relay-compiler --src ./src --schema ./schema.graphql --language typescript --extensions ts tsx js jsx"
这是我收到的错误:
Parse error: Error: RelayFindGraphQLTags: Operation names in graphql tags must be prefixed with the module name and end in "Mutation", "Query", or "Subscription". Got `CustomersQuery` in module `Main`.
有人知道为什么会这样吗?感觉像个bug。
【问题讨论】: