我正在尝试使用此网址中的本地架构: https://spacex-product.up.railway.app/
在我的数据模块中
apollo {
service("RocketsGraphQL") {
packageName.set("com.example.data")
schemaFiles.from("src/main/graphql/schema.graphqls")
}
}
错误: 导致:java.lang.IllegalStateException:在以下位置找不到架构文件:
在我的 schema.graphqls 中
""""""
type Address {
""""""
address: String
""""""
city: String
""""""
state: String
}
根据 Apollo3,您应该显式设置
srcDir()
。
这应该足够了。我的应用程序中甚至没有
schemaFiles.from
:
apollo {
service("RocketsGraphQL") {
srcDir("src/main/graphql/schema")
packageName.set("com.example.data")
}
}