我按照relay.dev上的步骤为我的react-native项目安装了中继。当我有一个空的模式文件时,运行编译器工作正常。将模式放入文件中开始抛出以下错误:
线程'main'在'Expect graphqlast存在'时恐慌。",/home/runner/work/relay/relay/compiler/crates/relay-compiler/src/compiler.rs: 335:14注意:使用
RUST_BACKTRACE=1
环境变量运行以显示回溯
我的schema文件是
// relay_schema.graphql
type Query {
tasks: [TaskNode]
}
type TaskNode {
id: ID!
}
和我的中继配置是:
module.exports = {
// ...
// Configuration options accepted by the `relay-compiler` command-line tool and `babel-plugin-relay`.
src: './src/',
language: 'flow',
schema: './relay_schema.graphql',
exclude: ['**/node_modules/**', '**/__mocks__/**', '**/__generated__/**'],
};
我完全不知道该怎么做
更新src到src: './'
后开始工作。最好对src
、schema
等路径进行验证。当被卡在这里时,编译器显示的错误信息没有多大帮助。