Skip to content

Output Option: NumberOfFiles #3532

Open
@Iron-Ham

Description

@Iron-Ham

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))
  )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegenIssues related to or arising from code generationfeatureNew addition or enhancement to existing solutions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions