Skip to content

Import queries instead of duplicating them on the generated output #6605

Open
@danielo515

Description

@danielo515

Is your feature request related to a problem? Please describe.

It is a problem we have with the way the output is generated, which leads to a very big file and failing static dependency analysis.

When using "typescript-operations" and "typescript-react-apollo" the generated output (which should include hooks and HOCs) the queries that are being used are duplicated on the generated file. This mean that the original file where the query is defined is detected as unused by our dependency analysis tools, because they are in fact unused. This is a problem because we used to have some big amounts of unused code and we don't want to get back to that situation. Also the generated output is huge, it is already 15k lines, which can be drastically reduced if the hooks were importing the queries rather than inlining them.

Describe the solution you'd like
I want an option where the queries are imported from their original file rather than being copy pasted to the generated output code.

Describe alternatives you've considered
I don't have any alternative

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreRelated to codegen core/clikind/questionImprovements or additions to documentationwaiting-for-answerWaiting for answer from author

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions