facebook / facebook/relay

Start uniquely naming node default exports in generated code

Open
#4,644 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Currently the default exports of `queryname.graphql.ts` and `queryname$parameters.ts` are simply named `node`. This makes it really cumbersome to work with import suggestions, as typing `node` will suggest every query in the whole project (see screenshot from VS Code).

image

Instead I suggest these exports get a unique name, so that the name of the query can be typed to get a single import suggestion from the IDE. Additionally the export could be exported as a named query in addition to the default export (to avoid breaking existing code).

Examples of names for the queries could be `queryNameNode` for `queryName.graphql.ts` and `queryNamePreloadable` for `queryName$parameters.ts`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.