Add $variables to ConcreteRequest
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Relay generates files from default node export of type `ConcreteRequest`.
There is also a separate type export `$variables`:
```
export type IndependentPaidProjectPageQuery$variables = {
id: string;
};
```
However, it seems that `ConcreteRequest` has all the necessary data to infer `$variables`:
```
> JSON.stringify(node.operation.argumentDefinitions)
< '[{"defaultValue":null,"kind":"LocalArgument","name":"id"}]'
```
Is there a way to infer `$variables` just from `ConcreteRequest` using TypeScript?
Being able to infer using a helper (or updating relay output to add `$variables` to `ConcreteRequest`) would reduce the need to import individual types, e.g. our route exports `ConcreteRequest`, which I would then like to use to infer what parameters to route loader needs to have – at the moment, the only way to do it is by separately importing `IndependentPaidProjectPageQuery$variables`.
Contributor guide
Assessment
This issue has not been assessed yet.