Skip to content

Feat: Option to trim whitespace from operation document in generated code #3069

@AnthonyMDev

Description

@AnthonyMDev

For users that want to minimize the payload of their networking requests, we can trim whitespace from the operation document string in the generated operation models.

The QueryStringLiteralFormat option in ApolloCodegenConfiguration has a singleLine case that already formats the string removing new line characters. We could add an associated value of trimWhitespace: Bool to this case to allow trimming all whitespace as well. It would not make sense to add this to the multiLineoption of course, which is why it should be an associated value on singleLine rather than a new standalone configuration option.

This should default to false in order to keep the default inline with the existing implementation and not make changes to generated code for users automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIssues outlining new things we want to do or things that will make our lives as devs easierfeatureNew addition or enhancement to existing solutionsgood first issueIssues that are suitable for first-time contributors.help wantedIssues the Apollo team would love help from the community aboutlow-priority

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions