-
Notifications
You must be signed in to change notification settings - Fork 347
uri not changing when set in createHttpLink and concated later on #609
Comments
👍 Experiencing same issue. |
I'm running into the same problem. After a quick look at this it "seems" like the request on these lines are made before we set the context using the setter function in the example and that's why it's using the default context values for the But I could be wrong as I haven't looked into this more than maybe 15 minutes. |
Thinking more about this I'm pretty sure I was wrong about this as the |
Are you using correct package for ApolloClient? I was experiencing same issue, untill I figured out I was importing ApolloClient from 'apollo-boost' and not from 'apollo-client' |
@cobsa, interesting I'll have a look |
@cobsa Turned out it actually was that problem, one of my colleagues had already changed the code so it was importing from |
I had the same issue, using |
So I'm pretty sure this was the problem for all of us and that an update to the docs or fix the problem with importing |
I have burned few hours here only to discover that the request was on the same url of the page, which is a backend with no graphql installed!, however, the error I got was misleading.. it should say for example: graphql is not installed on the backend or invalid endpoint.. etc What I was getting is:
|
I just got badly burnt by this as well. The error message you get if you use Apollo Boost is completely useless, and gives no indication of what the problem actually is. Renaming the |
Dears, can you share you full code. Thks |
@jejesh26 I am too facing the same issue. Seems like whatever I give to I am also using the |
Hello Everyone,
|
Thanks @hopewise, you saved me few hours! I was making the same mistake 😂 |
Over a year later and I got burned by this. Searching so many issues and guides keep giving me the same problem. Importing ApolloClient from apollo-client instead of apollo-boost worked for me! I wasted at least 4-5 hours trying to fix this. Thanks!! |
Seems like this can be closed then! Solution |
Expected Behavior
I'd want the endpoint to be set to a different url, but no matter what I change the variable to, it always tries to POST to /graphql
Code copied from official docs: https://www.apollographql.com/docs/react/recipes/authentication.html#Header
Actual Behavior
It tries to post to /graphql and throws an error.
Issue Labels
The text was updated successfully, but these errors were encountered: