We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
I want to be able to intercept and reject a request through the proxy by examining body content.
For example, my request coming through is a grapql query or mutation in body of POST
body
POST
mutation { registerUser ( ... ) { ... } }
and I want to be able to examine the content body for registerUser (or something else) and reject with a 403 - Forbidden.
registerUser
403 - Forbidden
I feel it's similar, but the opposite to here: #97
So I'd like to use onProxyReq, but I dont' know how to read the body and then make an action using req / res. Anyone can help?
onProxyReq
req
res
The text was updated successfully, but these errors were encountered:
Did you ever resolve this? I am trying to do the exact same. I also want to modify the graphql query in certain cases, and reject all mutations
Sorry, something went wrong.
You might want to try using a library like nock. It has tons of options to control the response.
nock
The following example will just respond with 403 on every graphql request.
var scope = nock('http://my.domain.com') .intercept('/graphql', 'POST') .reply(403);
Check their documentation for more fine grained control.
Please let us know if you have any succes with nock.
No branches or pull requests
I want to be able to intercept and reject a request through the proxy by examining body content.
For example, my request coming through is a grapql query or mutation in
body
ofPOST
and I want to be able to examine the content body for
registerUser
(or something else) and reject with a403 - Forbidden
.I feel it's similar, but the opposite to here: #97
So I'd like to use
onProxyReq
, but I dont' know how to read the body and then make an action usingreq
/res
. Anyone can help?The text was updated successfully, but these errors were encountered: