@(Apollo)[iOS]
Apollo踩过的坑
编译错误 xcode10.2
错误信息Apollo/Collections.swift:65:42: Cannot assign value of type 'EnumeratedSequence<[Key]>.Iterator' to type 'EnumeratedSequence<IndexingIterator<Array<Key>>>.Iterator'
原因: Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler
解决方法:
1)该错误已在master中修复,但还未若发布pod 'Apollo', :inhibit_warnings => true, :git => 'https://github.com/apollographql/apollo-ios.git', :branch => 'master'
未生成或更新API.swift
可能原因
- 加载nvm失败(版本过低)
check-and-run-apollo-cli.sh
文件中执行"$HOME/.nvm/nvm.sh"
中断,API.swift生成更新失败
image.png - 文件名应以
.graphql
其解析时,搜索以.graphql
结尾的文件 -
graphql
文件中格式错误
在无参数时添加不必要的()
image.png
正确写法为
image.png