Generate TypeScript types, even if not used in a query/mutation/fragment
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes we want to use a TypeScript type generated by Relay in multiple files. Right now, we do this by creating a separate module that is specifically for generating a type:
```
import graphql from "babel-plugin-relay/macro";
import { Email } from "types/relay/__generated__/Email_User.graphql";
const _fragment = graphql`
fragment Email_User on User {
# eslint-disable-next-line relay/unused-fields
emailBlocklist
}
`;
export default Email;
```
Is there a way to make the Relay compiler generate all object/enum/input/etc. types by default, instead of only generating them if they're used by a query/mutation/fragment? This would be useful when, for example, writing utility functions that take in some Relay type.
Contributor guide
Assessment
This issue has not been assessed yet.