Solve the bug: make Meteor & Vue communicate through Apollo Client / GraphQL Server #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @matteodem!
What does this PR:
The OPTIONS issue
I got the OPTIONS issue fixed (apollographql/meteor-integration#59)!
Thanks to apollographql/apollo-client#529 (comment): you can set up the
cors
at the level of thegraphqlExpressServer
My understanding of
OPTIONS
HTTP Request is limited (I didn't know about them before). It seems that it sent before any CORS request, maybe thegraphql-server-xx
should accept it with some find of filtering? (hypothesis)Someone got a similar one, but that didn't get really resolved. apollographql/apollo-server#269
Vue-apollo modifications
At this point, the request was made and I received a response!! 🚀
But as it gave me an error, I thought I could find the error and fix it as well 😙🎶
Thanks to vuejs/apollo#10 (comment), I've de/re structured what's given to the pure TrackList component.
I got a little fancy there, in order to make the component display the expected stuff:
Apollo dependencies update
That was not really needed, but I thought it would be good to be up to date to the latest/checked versions of the different Apollo & cie packages, I've updated them in the Meteor & Vue app.
Conclusion
That was great to understand, try and tackle this issue!! 👍 It's my first experience with Vue, it seems dope!!
Your app looks great, happy hacking man 🎉