dotansimha / dotansimha/graphql-code-generator

Import queries instead of duplicating them on the generated output

Open
#6,605 10 comments 1 reaction 0 assignees View on GitHub
core kind/question waiting-for-answer
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.