-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support refetching if options.body
changes, even if url doesn't
#28
Comments
Interesting point. I've always used We could look into supporting a way to trigger an automatic refetch based on other parameters (body, but not necessarily limited to it, for example changing headers, etc). In your case is it possible to issue the request manually, or does it need to be automatic (and the |
Yea, I admit that this is a bit of an odd usecase; the API we're calling is doing an analytic query, so it's not actually modifying state, but it may require a lot of input params that are better suited to a body and the query isn't computationally cheap, so it's a POST (I also didn't design the API we're calling, so I don't have much control over the decision :P) Yea, while Yea, there are plenty of workarounds. We could use |
@ncknuna I added support for this use case with a new I use this on new GraphQL component I'm working on where you always POST to the I need to update the docs to show |
@ncknuna Forgot to mention this is in |
Ah, cool, thanks :D |
In the version that I'm using,
react-fetch-component/src/Fetch.js
Line 58 in ad87862
In my code I'm using this component with a POST call with a body, where the user can modify the page state to change the body, which I'd like to trigger a refetch, but since the URL is the same, it doesn't. I worked around this by adding a fragment to the end of the URL that takes a hash of the body, but it'd be nice if this just worked by default. At minimum, it would be good if this behavior was documented, since I had to spend a decent amount of time poking around before I figured it out.
The text was updated successfully, but these errors were encountered: