hey, we have two different schema modules. all is ...
# apollo-kotlin
a
hey, we have two different schema modules. all is well. I get both generate commands (generate{Service}ApolloSources) When I try to pull in both of them into the same module, I receive this error:
Copy code
No matching variant of project :infra-apollo-schema was found. The consumer was configured to find a usage of 'apollo-metadata' of a component, as well as attribute 'com.apollographql.service' with value 'monolith' but:
          - Variant 'apolloStorefrontProducer' capability :infra-apollo-schema:1.0.0 declares a usage of 'apollo-metadata' of a component:
              - Incompatible because this component declares a component, as well as attribute 'com.apollographql.service' with value 'storefront' and the consumer needed a component, as well as attribute 'com.apollographql.service' with value 'monolith'
dependency looks like:
Copy code
apolloMetadata(project(":infra-monolith-schema"))
    implementation(project(":infra-monolith-schema"))

    apolloMetadata(project(":infra-apollo-schema"))
    implementation(project(":infra-apollo-schema"))
is such a configuration supported? or do we need to put the two references into two separate modules (not ideal)
b
Shouldn't you use 1 schema module but with 2 services for this case?
a
good point. we could do that
just curious if that was necessary
b
I've never tried this configuration but I'll have a look to see if I can repro at least 🙂
(although it does say here that
Multi-modules requires that one and only one module contains a schema.
) 😅
a
ahhh haha…i feel like that was known
ok thanks ill go about fixing!
b
if this can help there's a very simple multiservice+multimodule sample here
a
thanks! we have it otherwise all working well. it just ran into this issue when we wanted multiple schemas in same graphql module we created
105 Views