Vue-apollo: Does not work with meteor "apollo" package

Created on 28 Dec 2016  Â·  20Comments  Â·  Source: vuejs/vue-apollo

Get following error:

http://localhost:3000/graphql 405 (Method Not Allowed)
HTTPFetchNetworkInterface.fetchFromRemoteEndpoint @ VM8112:73
(anonymous) @ VM8112:90
localhost/:1 Fetch API cannot load http://localhost:3000/graphql. Response for preflight has invalid HTTP status code 405
vue-plugin.js?3c73:207 Error sending the query undefined TypeError: Failed to fetch

Using https://atmospherejs.com/meteor/apollo. Any idea for why the OPTION request needs to be made? Or is that the apollo client that is doing that?

bug need feedback

All 20 comments

I can't replicate this. I just tested with the latest meteor, latest apollo-client, and I could connect successfully to the meteor server apollo, and to an external graphql server.

Edit: here is a working example.

oh, I used a custom frontend (not meteorjs). But thanks for showing me an example, I'll try setting up the config similiarly to how the apollo package does.

Try upgrading the npm packages. The problem comes up when I upgrade graphql-tools to 0.8.4

I'll test it later today

Still doesn't work. Did you already try connecting with apollo-client from a custom webpack project? I can upload the project if it's not reproduceable for you

Yes, I'm working on an official vuejs.org app with Webpack and vue-apollo + an Apollo server.

Do you still encounter this issue?

Yes... I'll upload the repository again later today and hopefully you can reproduce it.

OK!

Le mar. 24 janv. 2017 17:06, Matteo De Micheli notifications@github.com a
écrit :

Yes... I'll upload the repository again later today and hopefully you can
reproduce it.

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/Akryum/vue-apollo/issues/18#issuecomment-274848132,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACqyfN3eqeSJ7rY5ynQpd4gDvxB8ZGAcks5rViFzgaJpZM4LXKCe
.

here it is: https://github.com/matteodem/vue-apollo-bug

Simply go once into code/api and code/web-app and do following for each folder:

npm install
npm run dev

Both apps need to be running. The api app is the graphql endpoint and the web-app just a webpack project with vuejs. I get following error when visiting the web app url:

error

any success?

Didn't have time to try yet. ;)

Le mer. 25 janv. 2017 à 17:36, Matteo De Micheli notifications@github.com
a écrit :

any success?

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/Akryum/vue-apollo/issues/18#issuecomment-275158765,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACqyfDq9VlA4d3xIjBNTV_0dy31hLtfCks5rV3oPgaJpZM4LXKCe
.

sure, sorry to stress you

I've tried the app, with the same error. In one of my project with apollo-server, the client makes 2 requests with the OPTIONS method. But the meteor package rejects it, so I wonder if its internal apollo packages are up-to-date.

@matteodem Did you try setting up apollo server manually?

no, do you have an example of doing that with meteorjs?

You can get inspiration from this or maybe try to clone the meteor/apollo package and update the dependencies.

This has been solved in the meantime, thanks for helping out

Just for reference I had the very same problem although I'm not using meteor. Indeed I'm using the classic vue webpack dev server and an express apollo server.

I solved my problem thanks to this post. I hope it'll help others too facing the same issue:
https://forums.meteor.com/t/solved-cors-errors-with-apollo-on-meteor-1-4x/29465

Was this page helpful?
0 / 5 - 0 ratings

Related issues

khaledosman picture khaledosman  Â·  20Comments

karladler picture karladler  Â·  17Comments

shomodj picture shomodj  Â·  15Comments

aleks63 picture aleks63  Â·  46Comments

bbugh picture bbugh  Â·  12Comments