Description
Use case
Currently, we output one file per operation or fragment definition. However, we've found that we can improve our overall compile time by limiting the number of output files in codebases with many generated files.
For example, in our app, we previously had a whopping 5,807 generated files. By reducing it such that we only had under 1000 files generated in total (leaving the files generated under Schema/
alone) per supported GraphQL schema, that we were able to isolate a 45% reduction in the compile time for our GraphQL targets.
While we can script the outputs into a given set of bucketed files, this seems like a universally useful argument for ApolloCodegenConfiguration.OutputOptions
or ApolloCodegenConfiguration.FileOutput
, such that we can specify a number of output files for the operations and have operations bucketed by Apollo.
Describe the solution you'd like
Ideally:
ApolloCodegenConfiguration(
...
options: ApolloCodegenConfiguration.OutputOptions(
selectionOutputFiles: .grouped(.alphabet) // or .standard, .grouped(.numerical(10))
)
)