-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(admin-ui): Add React useLazyQuery hook #2498
feat(admin-ui): Add React useLazyQuery hook #2498
Conversation
✅ Deploy Preview for effervescent-donut-4977b2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks, this looks like a nice addition, and good work with the documentation too. Could you make this against the |
Do you have an estimated date for the next minor release? |
I understand :) I don't have a date for the next minor but I will start releasing the current minor under the Another option is to temporarily implement this in your own code. It would be OK to add an |
310c686
to
0f03454
Compare
export |
Description
The aim is to be able to execute a graphql query in response to an event (a click on a button for example). In the same way as we do with useMutation. Today, the useQuery is executed as soon as the React component is loaded, which limits its use.
A complete example of use is available in the code.
More info about useLazyQuery in Apollo documentation
Breaking changes
No breaking changes
How to test
In dev-server/ui-extensions-library/ui/react-components/ReactUI.tsx
Add
Screenshots
demo.mov
Checklist
📌 Always:
⚡ Most of the time: