I’m in the process of converting to apollo3 (using beta 1). I added a
service
. When I build it, I get the following error:
Copy code
Could not determine the dependencies of task ':app:generateServiceApolloSources'.
> Could not resolve all task dependencies for configuration ':app:apolloServiceConsumer'.
> No variants of project :graphql-model match the consumer attributes:
- Configuration ':graphql-model:default':
- Incompatible because this component declares a runtime of a component and the consumer needed a usage of 'apollo-metadata' of a component
- Other compatible attribute:
- Doesn't say anything about com.apollographql.service (required 'service')
Nick
10/27/2021, 2:08 PM
My service configuration:
Copy code
apollo {
service("MyApp") {
generateApolloMetadata.set(true)
packageName.set("com.myapp")
// this will create a downloadMyAppApolloSchemaFromIntrospection task
introspection {
endpointUrl.set("<https://api.MyApp.com/api/gql>")
schemaFile.set(file("src/main/graphql/config/schema.graphqls"))
}
}
}
m
mbonnin
10/27/2021, 2:15 PM
Do you have 2 modules in your project?
mbonnin
10/27/2021, 2:16 PM
You most likely need to use
Copy code
service("service") {
...
}
in both modules (
app
and
graphql-model
)
n
Nick
10/27/2021, 2:16 PM
i have several modules
m
mbonnin
10/27/2021, 2:16 PM
And set
Copy code
generateApolloMetadata.set(true)
in
graphql-model
n
Nick
10/27/2021, 2:16 PM
i have to do that for every module?
m
mbonnin
10/27/2021, 2:17 PM
All modules sharing the same schema need to use the same service name