-
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
REST endpoint doesn't replace path variables if supplied in HOC callback #197
Comments
Note that, in addition, if you use a standard Graphql query (remove the "@rest" segment) I can see the variables are sent in the variables header. |
After some further research, it appears that the following line is removing the values from the arguments object (it returns null) before it ends up at the pathBuilder. I may be incorrect, but it's as far as I can see:
|
As a note to anyone else - this also breaks the in-memory cache, as the cache unique key is not properly defined and things get overwritten. Unfortunately, the in-memory cache doesn't work properly either... apollographql/apollo-client#3452 |
I don't really use the GraphQL HOC pattern. Happy to support any pull-requests that will fix this functionality! Sorry I didn't see this issue until now @davewthompson |
I'm seeing a similar issue: https://stackoverflow.com/questions/75435714/apollo-client-ignoring-argument-for-gql-rest-query Is this the same bug? Is there a workaround? |
@MarvinNorway — Have you logged your I don’t think that StackOverflow is the same issue as what is described in this thread. |
@fbartho Yes, I verified that in the debugger in the browser. So it's really odd... |
@fbartho The problem was that the parameter has to be declared twice:
|
@MarvinNorway Ah! Yes, there’s complicated Apollo/GraphQL-internal reasons why that’s necessary! (The I’ll leave this ticket open for now, but will eventually close it, as we finally have a solution, albeit 5 years later. |
Given below code:
The URL requested by apollo-link-rest doesn't include the supplied value, and the following error is logged to the console:
The text was updated successfully, but these errors were encountered: