`graphql-codegen-client-preset`: support configurable document/fragment variable suffixes
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the graphql-codegen-client-preset SWC plugin and compare its generated import identifiers with the upstream codegen options listed in the issue. Verify how document and fragment prefixes, suffixes, deduplication, and omitted operation suffixes should affect names. Done means all six options are configurable while preserving the current defaults.
Written by the indexing model from the issue text.
Description
The plugin hardcodes "Document" and "FragmentDoc" when generating import identifiers for operations and fragments.
This means if you set documentVariableSuffix: '' in your codegen config (a supported option), the plugin generates mismatched imports - it looks for GetUserDocument but codegen exports GetUser.
The upstream codegen has several options that affect variable names:
documentVariablePrefix/documentVariableSuffixfragmentVariablePrefix/fragmentVariableSuffixdedupeOperationSuffixomitOperationSuffix
None of these are currently configurable in the SWC plugin.
I have a PR ready that adds all six options with backwards-compatible defaults.
- Dominant language
- Rust
- Stars
- 389
- Forks
- 106
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from swc-project/plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swc-project/plugins#655 ·
-
swc-project/plugins#656 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
swc-project/plugins#612 · 1 comment ·
-
swc-project/plugins#577 · 1 assignee ·
-
enhancement
swc-project/plugins#574 · 8 comments · 1 assignee ·
All issues in swc-project/plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100