Skip to content
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

Parsing extensions contained in response #1016

Open
matteofoccoli opened this issue Aug 26, 2024 · 1 comment
Open

Parsing extensions contained in response #1016

matteofoccoli opened this issue Aug 26, 2024 · 1 comment
Milestone

Comments

@matteofoccoli
Copy link

Hello, my understanding is that at the moment, the GraphQlResponse grants access to data and errors. In our use case we're calling an external provider (Braintree) that provides also an extensions object in the response (here is their documentation).

Would it be possible to access that field in the response? We were able to parse extensions contained in the errors but not if they are contained in the response itself...

@obmarg
Copy link
Owner

obmarg commented Aug 27, 2024

Hi @matteofoccoli - thanks for the report. This is something cynic probably should support, but you're correct - at the moment it does not. Unfortunately I might need to make a breaking change to fix this, since the obvious fix would be adding another generic parameter into GraphQlResponse.

I am planning a major release sometime soon, so I may need to fix this as part of that - though I can't say exactly when that'll be.

In the meantime you can probably get at this field by using your own GraphQlResponse and integrating that with the http client library of your choice. I appreciate that it's not ideal but it shouldn't be too much code - the http & response modules in cynic are relatively simple and you probably only need a subset of them.

@obmarg obmarg added this to the 4.0.0 milestone Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants