-
Notifications
You must be signed in to change notification settings - Fork 70
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
The client.do (unexported) function should create a new request #241
Comments
Thanks a issues. |
I don't understand what you mean, you don't intend to overwrite the contents of gqlinfo. But we as users might want to override. We also want to be able to retry easily. This wouldn't be a breaking change, just a new feature. Actually as long as I can call |
I am using a retry mechanism similar to the implementation below, and retries are occurring without any issues. In cases where retries are not happening, even if you implement it straightforwardly using a for loop, wouldn’t it be called multiple times? I prefer not to overwrite gqlInfo because doing so would mean the behavior changes depending on the order of interceptors, due to whether the information is overwritten or not. As a result, interceptors that were previously working correctly might stop functioning properly due to the influence of other interceptors.
|
I think it looks good, thanks. |
Currently, in the
client.Post
method, we create a request, then run the request through interceptor chain, if one interceptor were to changeGQLRequestInfo
, it won't get reflected.If we moved the logic of creating the body of the request from client.Post to client.do function, then it'd be possible to change the
GQLRequestInfo
as well as it'd make retrying much more easy since for every chained intercept calls, it'd create a new request.This currently won't work:
In the above example, neither the retry works, nor the operation name.
If we moved the logic of creating the body from client.Post to client.do function it'd work.
I know we can use a custom do function, but that's a little complicated since we generate code in a repository that's trigerred from another repository and we use the interface name generation, which means we do not have the access to the clientv2.Client either.
I'm willing to send a PR if you'd accept this.
The text was updated successfully, but these errors were encountered: