I’m in the process of converting to apollo3 (using...
# apollo-kotlin
n
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')
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
Do you have 2 modules in your project?
You most likely need to use
Copy code
service("service") {
  ...
}
in both modules (
app
and
graphql-model
)
n
i have several modules
m
And set
Copy code
generateApolloMetadata.set(true)
in
graphql-model
n
i have to do that for every module?
m
All modules sharing the same schema need to use the same service name
n
gotcha, thanks 👍