我在 xcode 项目 (xcode --version 14 && swift --version 5.7) 中工作,并构建了一个 apollo 客户端项目,在其中生成 query.graphql 文件后,我在生成的 Schema 包中遇到了这个错误执行以下命令:-
to build apollo-io-cli
git clone https://github.com/apollographql/apollo-ios.git
cd apollo-ios
make build-cli
find . -name apollo-ios-cli
copy the found apollo-io-cli to your directory where you have schema.json file
run from that directory
./apollo-ios-cli generate
this will generate the swift files for graphql
这里我使用的是 apollo-ios 版本 1.0.2
最佳答案
可能,您将模式命名为“模式”,这会带来冲突。尝试将其重命名为其他名称
关于ios - 'SchemaMetadata' 不是 'Self.Schema' 类型的成员类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74161471/