agrosner
11/06/2025, 6:40 PMmbonnin
11/06/2025, 6:51 PMmbonnin
11/06/2025, 6:51 PMmbonnin
11/06/2025, 6:52 PMmbonnin
11/06/2025, 6:55 PMagrosner
11/06/2025, 6:58 PMBaseFakeResolver != DefaultFakeResolver where I could pass __Schema.all what is the replacement now?agrosner
11/06/2025, 7:19 PM/**
* Overrides the way the generated data builders are connected.
* Use this if you want to connect the generated models to another task than the default destination.
*
* By default, the generated sources are connected to:
* - main sourceSet for Kotlin projects
* - commonMain sourceSet for Kotlin multiplatform projects
* - main sourceSet for Android projects
*/
fun dataBuildersOutputDirConnection(action: Action<in DirectoryConnection>)
since its connected to only test directories nowmbonnin
11/06/2025, 8:04 PMmbonnin
11/06/2025, 8:04 PMbutLooking into this!=BaseFakeResolverwhere I could passDefaultFakeResolverwhat is the replacement now?__Schema.all
agrosner
11/06/2025, 8:06 PMdataBuildersOutputDirConnection {
connectToAllAndroidVariants()
}
however the task
> Task :infra-apollo-schema:generateStorefrontDataBuildersApolloSources
is taking serveral minutes to run / not completingmbonnin
11/06/2025, 8:07 PMmbonnin
11/06/2025, 8:07 PMagrosner
11/06/2025, 8:27 PM:infra-apollo-schema:generateStorefrontDataBuildersApolloSources | 13M43S | 46% | ████████████████████████████████████████████████████████████████████████████████
13 minutes 😖mbonnin
11/06/2025, 8:27 PMagrosner
11/06/2025, 8:27 PMagrosner
11/06/2025, 8:28 PMmbonnin
11/06/2025, 8:28 PMmbonnin
11/06/2025, 8:28 PMmbonnin
11/06/2025, 8:29 PMunitTest here)mbonnin
11/06/2025, 8:30 PM> butTrying to understand. Do you need to actively pass!=BaseFakeResolverwhere I could passDefaultFakeResolverwhat is the replacement now?__Schema.all
__Schema.all? If you extend DefaultFakeResolver() it should work. One example is here: https://github.com/apollographql/apollo-kotlin/blob/e994e2fb9eee52356c177f4bff55b8[…]ts/data-builders-kotlin/src/test/kotlin/test/DataBuilderTest.ktagrosner
11/06/2025, 8:31 PMagrosner
11/06/2025, 8:31 PMTrying to understand. Do you need to actively pass __Schema.all? If you extend DefaultFakeResolver() it should work. One example is here:
is this now code generated? previously wasntagrosner
11/06/2025, 8:32 PMmbonnin
11/06/2025, 8:33 PM__Schema types. We added a bunch of stuff there over the year but never really thought it throughagrosner
11/06/2025, 8:33 PMagrosner
11/06/2025, 8:35 PMdataBuildersOutputDirConnection {
resetConnection()
connectToAndroidSourceSet("main")
}
then id get IDE autocompleteagrosner
11/06/2025, 8:37 PMmbonnin
11/06/2025, 8:37 PMdataBuildersOutputDirConnection{} this is what it is doingagrosner
11/06/2025, 8:37 PMmbonnin
11/06/2025, 8:37 PMagrosner
11/06/2025, 8:37 PMmbonnin
11/06/2025, 8:37 PMagrosner
11/06/2025, 8:37 PMmbonnin
11/06/2025, 8:38 PMmbonnin
11/06/2025, 8:38 PMagrosner
11/06/2025, 8:38 PMmbonnin
11/06/2025, 8:38 PMmbonnin
11/06/2025, 8:39 PMwe use the main source set for mocking behind code logic in debug source set, using the data builders to make it easier to construct themI'm not sure I follow 100% here
mbonnin
11/06/2025, 8:40 PMmbonnin
11/06/2025, 8:41 PMconnectToAndroidSourceSet("main") should be doing. But AGP doesn't really want us to do this, I can't really remember whyagrosner
11/06/2025, 8:41 PM@ContributesTo(AppScope::class)
@Module
object ImmersiveCategoryMockModule {
@Provides
@IntoMap
@MockOperationKey(GetCategoryBlockBuilderQuery::class)
fun mockICPQuery(): MockOperation<*> = MockDataOperation(
handlesRequest = { op: GetCategoryBlockBuilderQuery -> op.categoryId == "0" },
) { resolver, _ ->
GetCategoryBlockBuilderQuery.Data(resolver = resolver) {
blockBuilderCategoryExperience = buildBlockBuilderCategoryExperience {
blocks = listOf(
buildBlockBuilderConfidenceBar { },
buildBlockBuilderGuide { },
buildBlockBuilderBanner { },
buildBlockBuilderBuyingGuideRow { },
buildBlockBuilderCardRow { },
buildBlockBuilderFreeShippingBanner { },
)
}
}
}
}agrosner
11/06/2025, 8:42 PMAt the end of the day, you have several "variants":
• debug
• release
• unitTest
• androidTest (IIRC)
[3:41 PM]
Do you need the data builders in all the variants? Because this is whatyeah thats why it probably took a long time to compile. but interesting AGP doesnt want us to do this...should be doing. But AGP doesn't really want us to do this, I can't really remember whyconnectToAndroidSourceSet("main")
mbonnin
11/06/2025, 8:44 PMwe have a testing module that exposes a fake resolver that applies custom logic for scalar adapters. its in main source setCould you make this a non-android plain JVM module? Variants + libraries are adding a lot of complexity
mbonnin
11/06/2025, 8:46 PMgenerateFooDataBuilderSources then it should be called only once for all variants.agrosner
11/06/2025, 8:53 PM