Skip to content

Overwriting query in Apollo plugin #6113

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

Closed
demeyerthom opened this issue Dec 12, 2024 · 3 comments
Closed

Overwriting query in Apollo plugin #6113

demeyerthom opened this issue Dec 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working libraries sdk

Comments

@demeyerthom
Copy link

Hi all.

I seem to be running into an issue when trying to implement the experimental_persistedDocuments option in useHive. When enabling this together with using the APQ functionality (sending the query hash in an extensions field) I get errors in the requestPipeline of Apollo that my sha does not match the query (found here).

I think this is caused by the logic around persistedDocuments overwriting the context.request.query field when no document was found (here). This subsequently messes up the requestPipeline of Apollo as it expects that field to be undefined when doing the GET request part of the APQ loop. Instead it now finds a query body {__typename} with which it generates an invalid hash.

Is this somehow intended behaviour? Or am I missing some bit of the APQ loop? It feels like the plugins should not be replacing the query content?

Thanks in advance!

@kamilkisiela kamilkisiela added bug Something isn't working sdk labels Jan 31, 2025 — with Linear
@jasonkuhrt jasonkuhrt added the libraries label Jan 31, 2025 — with Linear
@n1ru4l n1ru4l self-assigned this Mar 5, 2025
@n1ru4l
Copy link
Contributor

n1ru4l commented Mar 5, 2025

Hey @demeyerthom can you share why you are using both APQ and persisted documents together? Usually you want to either use one, or do you mean that the apollo APQ logic kicks in without you explicitly doing something here?

Would it be possible for you to create a minimal reproduction to share with us here?

@n1ru4l
Copy link
Contributor

n1ru4l commented Mar 25, 2025

Hey @demeyerthom is this issue still relevant?

@demeyerthom
Copy link
Author

Hi @n1ru4l no it is not relevant anymore. I closed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libraries sdk
Development

No branches or pull requests

4 participants