Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat: add @vue/apollo example implementation #70

Closed
wants to merge 17 commits into from

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Apr 9, 2021

This is now updated to work with new examples layout, and with a sample graphql server backend to show it in action.

We currently need to transpile @vue/apollo-composables as it does not provide a CJS build but only AMD or ESM (see vuejs/apollo#1081).

closes nuxt/nuxt#11729

examples/vue-apollo/pages/index.vue Outdated Show resolved Hide resolved
examples/vue-apollo/package.json Show resolved Hide resolved
examples/vue-apollo/package.json Outdated Show resolved Hide resolved
examples/vue-apollo/plugins/apollo.js Outdated Show resolved Hide resolved
@pi0 pi0 self-assigned this Jun 8, 2021
@pi0
Copy link
Member

pi0 commented Jun 17, 2021

@danielroe Do you plan on finishing example with server or should we do it later? (asking to avoid keeping stalled PR)

@danielroe
Copy link
Member Author

@pi0 Thanks for the ping. I think @vue/apollo should now work given that onServerPrefetch has now landed so I will finish this off (unless you want to do so sooner)...

@pi0
Copy link
Member

pi0 commented Jun 17, 2021

Sure. Please ping me when ready to squash (since WIP is locked for merge)

@danielroe
Copy link
Member Author

@pi0 Should be good to go now (though note issue with transpilation).

@danielroe danielroe requested a review from pi0 June 24, 2021 11:38
@danielroe
Copy link
Member Author

danielroe commented Jul 15, 2021

Current issue with native esm:

Directory import '/framework/examples/vue-apollo/.output/server/node_modules/@apollo/client/core' is not supported resolving ES modules imported from /framework/examples/vue-apollo/.output/server/chunks/app/server.mjs

It may just be an issue anyone will face with esm - implementing workaround but it will need to be fixed upstream I think.

@pi0
Copy link
Member

pi0 commented Sep 29, 2021

Closing as is stalled. Will rework later on (probably to nitro demo or fresh example)

@pi0 pi0 closed this Sep 29, 2021
@pi0 pi0 deleted the experiment/vue-apollo-example branch September 29, 2021 18:30
@tobiasdiez
Copy link
Contributor

@pi0 @danielroe I would be interested in providing an up-to-date GraphQL example.

What is the problem with this PR?

I was also wondering about the best way to create the graphql server with h3. This example here uses the express middleware which seems to be overkill. Maybe its worth to create a special h3 middleware and add it to https://www.apollographql.com/docs/apollo-server/integrations/middleware/?

@pi0
Copy link
Member

pi0 commented Oct 19, 2021

@tobiasdiez Indeed. We even made apollo express middleware work for Apollo but it is overkill (https://github.com/nuxt/nitro-demo/blob/main/server/graphql.js) so PR welcome there if you want to improve it and enable it back in demo.

Finally, I want to move integration to [nuxt-community/apollo-module)(https://github.com/nuxt-community/apollo-module) with bridge and nitro support this way others need to have just a module

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

Successfully merging this pull request may close these issues.

experiment provide/inject with @vue/apollo
3 participants