Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useFragment does not support variables or other base options #711

Open
bembleton opened this issue May 10, 2024 · 1 comment
Open

useFragment does not support variables or other base options #711

bembleton opened this issue May 10, 2024 · 1 comment

Comments

@bembleton
Copy link

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.

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.

useSomeDataFragment({
   identifiers: { id: "1234" },
   optimistic: true,
   variables: { first: 10 },
   client: customClient
});

Additional context

@rohit-gohri
Copy link
Contributor

Opened a PR here - #742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants