Android apollo3 架构未找到

问题描述 投票:0回答:1

我正在尝试使用此网址中的本地架构: https://spacex-product.up.railway.app/

在我的数据模块中

apollo {
    service("RocketsGraphQL") {
        packageName.set("com.example.data")
        schemaFiles.from("src/main/graphql/schema.graphqls")
    }
}

enter image description here

错误: 导致:java.lang.IllegalStateException:在以下位置找不到架构文件:

在我的 schema.graphqls 中

""""""
type Address {
    """"""
    address: String

    """"""
    city: String

    """"""
    state: String
}
android gradle groovy graphql apollo
1个回答
0
投票

根据 Apollo3,您应该显式设置

srcDir()

参考:指定架构和.graphql文件

这应该足够了。我的应用程序中甚至没有

schemaFiles.from
:

apollo {
    service("RocketsGraphQL") {
        srcDir("src/main/graphql/schema")
        packageName.set("com.example.data")
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.