android 上的 Apollo:无法下载架构或生成 类

Apollo on android: can't download schema or generate classes

我是第一次尝试 Apollo 和 graphql,我想使用 this api and I'm following the official example here。不过

运行正在执行架构下载任务

gradlew :app:downloadApolloSchema --endpoint='https://countries.trevorblades.com/' --schema='app/src/main/graphql/com/trevorblades/countries/schema.json'

结果

 Execution failed for task ':app:downloadApolloSchema'.
> Expected URL scheme 'http' or 'https' but no colon was found

我想使用的回购和示例的。

如果我尝试使用存储库页面上的按钮手动下载架构,请将其放在正确的目录中,然后 运行

gradlew generateApolloSources

结果是

 Failed to parse GraphQL schema introspection query from `[...]app\src\main\graphql\com\trevorblades\countries\schema.json`

再次使用我的存储库和示例中的存储库。

我觉得我在这里遗漏了一些非常微不足道的东西,但我真的想不通。

任何帮助将不胜感激。

尝试 JS GraphQL IDEA plugin, which might make life a tad easier. And as it suggested here ...您可能根本没有传递有效的端点。尝试 --endpoint=https://countries.trevorblades.com/" 双引号。错误消息肯定是关于 --endpoint 而不是关于 --schema。我怀疑 Windows 可能不喜欢这些 ' 单引号 (显然同样适用于 --schema)。

gradlew.bat :app:downloadApolloSchema --endpoint=https://countries.trevorblades.com/ --schema=app/src/main/graphql/com/trevorblades/countries/schema.json

或:

gradlew.bat :app:downloadApolloSchema --endpoint="https://countries.trevorblades.com/" --schema="app/src/main/graphql/com/trevorblades/countries/schema.json"