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

createUploadLink fetching wrong uri #114

Closed
trevorlitsey opened this issue Sep 1, 2018 · 5 comments
Closed

createUploadLink fetching wrong uri #114

trevorlitsey opened this issue Sep 1, 2018 · 5 comments
Labels

Comments

@trevorlitsey
Copy link

Hi!

I'm trying to set up apollo-upload-client and can't get Apollo to fetch queries from the correct URL. It will only fetch from the same port as the client server.

Here is my Apollo client setup:

const client = new ApolloClient({
	link: createUploadLink({
		uri: 'http://localhost:4000/graphql',
	}),
	cache: new InMemoryCache(),
});

My client server is running on port 3000, so it tries to fetch http://localhost:3000/graphql even though that is not the uri I provide in the options.

From taking a quick look at the source code I'm not sure why I'm having this issue. I have a feeling I'm missing something obvious?

Any help is appreciated! Thanks!

@jaydenseric
Copy link
Owner

Are you importing ApolloClient from apollo-boost? If so, you need to stop using it and setup Apollo Client manually.

@jaydenseric
Copy link
Owner

Hopefully that was your issue.

@trevorlitsey
Copy link
Author

Thank you for the pointer! Just got back to figuring this out and it was indeed apollo-boost. Thank you!

Would you be open to a small PR to amend the docs to warn against using apollo-boost?

@jaydenseric
Copy link
Owner

It is in there already 😅

screen shot 2018-09-27 at 1 48 00 pm

@trevorlitsey
Copy link
Author

hazza!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants