https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
a

agrosner

08/22/2022, 2:24 PM
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

bod

08/22/2022, 2:28 PM
Shouldn't you use 1 schema module but with 2 services for this case?
a

agrosner

08/22/2022, 2:28 PM
good point. we could do that
just curious if that was necessary
b

bod

08/22/2022, 2:30 PM
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

agrosner

08/22/2022, 2:31 PM
ahhh haha…i feel like that was known
ok thanks ill go about fixing!
b

bod

08/22/2022, 2:33 PM
if this can help there's a very simple multiservice+multimodule sample here
a

agrosner

08/22/2022, 2:34 PM
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
78 Views