dotansimha / dotansimha/graphql-code-generator-community
useFragment does not support variables or other base options
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
**Is your feature request related to a problem? Please describe.**
The `useFragment` hook generation only sets the fragment and from options, but does not include the other base options for `variables`, `optimistic`, and `client`.
**Describe the solution you'd like**
Add a second, options param to include any missing options from the base fragment options type.
```ts
useSomeDataFragment({ id: "1234" }, {
optimistic: true,
variables: { first: 10 },
client: customClient
});
```
**Describe alternatives you've considered**
Replacing the existing 'identifiers' param with a more traditional FragmentOptions that accepts the IDs and base options, although this would be a breaking change without duck-typing.
```ts
useSomeDataFragment({
identifiers: { id: "1234" },
optimistic: true,
variables: { first: 10 },
client: customClient
});
```
**Additional context**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.