-
Notifications
You must be signed in to change notification settings - Fork 122
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
Allow body passing for non-POST/PUT requests. #230
Comments
Join to previous. This is a very necessary feature. |
+1 to this request. What's the latest on it? 😅 |
Any work around for this? |
I'm slightly partial to allowing people to override the array of Verbs that have banned bodies, something like: const link = new RestLink({
httpVerbsWithBannedBodies: ["GET", "DELETE"], // default
}) No work has been done that I'm aware of @Fvaco. |
...any plans to do work around this? |
I have no plans to work on this @OZhurbenko If this is high value to you, I could see it as an option on the endpoint config, are you interested in providing a PR? |
Is there any possibility to add this? I agree with the top comment that a body with a GET request is not best practice. However, I am needing to make a REST request to a server that does not follow best practices and which I don't have control over. |
Allow an optional flag to enable passing body params with
DELETE
andGET
. Yes, technically we shouldn't do it, but there are servers out there that don't follow the best practices, and since most systems will allow it any way, we should have a way to do it. My suggestion is simply another flag in configuration that toggles whether or not to support that (in fact maybe we could create a capabilities matrix for non-standard HTTP features if this is a longer list).Once there we just need to change this line:
https://github.com/apollographql/apollo-link-rest/blob/master/src/restLink.ts#L971
to be:
We can even add a warning to the dev builds that says "Warning you appear to be trying to pass a body to a delete or get operation, if this is intended you should switch on the
allowNonStandardBodies
flag. Or we could replace the hardcoded:['GET', 'DELETE']
with a overridable config so the users can decide which ones to support bodies for.The text was updated successfully, but these errors were encountered: