Replies: 2 comments 7 replies
-
I ran into such use case a few month ago and this is how I approached it:
When you want it to fetch just run For mutations just use provided |
Beta Was this translation helpful? Give feedback.
-
in most cases, you don't just want to fetch on a button press, but when a user has made / finished some interaction that is relevant for your query:
with that, I can make a filters form with a submit button that the user can fill out. Once they click submit, I can call notes:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do I run queries on trigger? My use case is using GraphQL and want to run GrapqhQL queries/mutations on button press.
Update: Oh I am forgotten the crucial part: How do I do this in React Native components? Because I'm getting
Unhandled promise rejection, [Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
Below is the snippet of
Pressable
component I used:Update: Here is the code: https://github.com/mangkoran/crowdfinder-client/blob/50fb4a3cbb70806881c78ea0740c1ccfaef73fc1/utils/activity.js#L29
and here is where I use it: https://github.com/mangkoran/crowdfinder-client/blob/50fb4a3cbb70806881c78ea0740c1ccfaef73fc1/screens/CreateActivityScreen.js#L39
Beta Was this translation helpful? Give feedback.
All reactions