Jan Skrasek
08/03/2022, 8:18 AMIf two sibling modules use the same schema type and this schema type wasn't generated upstream, each module will generate its own version of the schema type, which could clash. To prevent this, Apollo Kotlin registers a global "check${service}ApolloDuplicates" task that will fail if there are duplicates.Hello. I do not much understand this. • Could clash means exactly what? Our two modules has different package names, so I guess they cannot clash, can they? • Is the check "preemptive" in a way it fails even they do not clash (because of those package names)? Thank you 🙂
mbonnin
08/03/2022, 8:19 AMOur two modules has different package names, so I guess they cannot clash, can theyThat's the catch. Because there's only one schema, all the "schema" types will use the same package name
mbonnin
08/03/2022, 8:19 AMmbonnin
08/03/2022, 8:22 AM:schema
- schema.graphqls
- query1 that uses input type Input1
:feature
- query1 that uses input type Input2Input2mbonnin
08/03/2022, 8:23 AMalwaysGenerateTypesMatching.set(listOf(".*"))Jan Skrasek
08/03/2022, 8:29 AMWhich is the package name of the "schema" moduleSo ours feature module setup will not work?
val packagePath = "xxx." + path.replace(":", ".") + ".network"
packageName.set(packagePath)mbonnin
08/03/2022, 8:29 AMmbonnin
08/03/2022, 8:30 AMmbonnin
08/03/2022, 8:31 AMpackageNamepackageNamembonnin
08/03/2022, 8:31 AMJan Skrasek
08/03/2022, 8:34 AMmbonnin
08/03/2022, 8:37 AMmbonnin
08/03/2022, 8:38 AMmbonnin
08/03/2022, 8:40 AMJan Skrasek
08/03/2022, 8:41 AMJan Skrasek
08/03/2022, 8:43 AMmbonnin
08/03/2022, 8:46 AMJan Skrasek
08/03/2022, 8:46 AMmbonnin
08/03/2022, 8:47 AMalwaysGenerateTypeMatchingmbonnin
08/03/2022, 8:48 AMalwaysGenerateTypeMatchingJan Skrasek
08/03/2022, 8:49 AMmbonnin
08/03/2022, 8:51 AMBecause the current check doesn't tell us that, right?The current check will tell you something like:
type 'SomeInputType' is used in sibling modules :feature1 :feature2, use alwaysGenerateTypesMatching in a parent modulealwaysGenerateTypesMatchingmbonnin
08/03/2022, 8:51 AMJan Skrasek
08/03/2022, 8:53 AMmbonnin
08/03/2022, 8:53 AMmbonnin
08/03/2022, 8:54 AMmbonnin
08/03/2022, 8:55 AMmbonnin
08/03/2022, 8:55 AMmbonnin
08/03/2022, 8:58 AMWe wouldn't mind having some types duplicated in feature modulesFeel free to open an issue about this and we can experiment
Jan Skrasek
08/03/2022, 8:58 AMJan Skrasek
08/03/2022, 8:59 AMmbonnin
08/03/2022, 9:00 AM