Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

with-apollo example is outdated #122

Open
overpod opened this issue Oct 12, 2018 · 1 comment
Open

with-apollo example is outdated #122

overpod opened this issue Oct 12, 2018 · 1 comment

Comments

@overpod
Copy link

overpod commented Oct 12, 2018

I'm moving back to run an example with-apollo

Error

<ApolloProvider>.provide() is deprecated. Use the 'apolloProvider' option instead with the provider object directly.
TypeError: Cannot read property 'getMatchedComponents' of undefined
    at _callee$ (node_modules/ream/lib/plugins/apollo/apollo-inject.js:7:0)
    at tryCatch (/home/trofimov/Документы/projects/ream/examples/with-apollo/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/trofimov/Документы/projects/ream/examples/with-apollo/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/home/trofimov/Документы/projects/ream/examples/with-apollo/node_modules/regenerator-runtime/runtime.js:114:21)
    at asyncGeneratorStep (server.js:977:103)
    at _next (server.js:979:194)
    at server.js:979:364
    at new Promise (<anonymous>)
    at server.js:979:97
    at server.js:1018:19
    at _callee$ (node_modules/ream/app/utils.js:41:0)
    at tryCatch (/home/trofimov/Документы/projects/ream/examples/with-apollo/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/home/trofimov/Документы/projects/ream/examples/with-apollo/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/home/trofimov/Документы/projects/ream/examples/with-apollo/node_modules/regenerator-runtime/runtime.js:114:21)
    at asyncGeneratorStep (server.js:836:103)
    at _next (server.js:838:194)

help me please

@IlyaSemenov
Copy link
Contributor

If you had inspected ctx you would immediately discover that the router is now accessible under ctx.rootOptions.router. The middleware API has been changing lately (and I think has not yet stabilized).

I have no idea what Apollo is but apparently its API has also evolved since the example has been originally prepared. See https://akryum.github.io/vue-apollo/guide/ssr.html#on-the-server.

For starters, you would get rid of provide() and replace it with:

ctx.rootOptions.apolloProvider = apolloProvider

It's not immediately clear how the prefetchAll call should be adjusted. If you figure it out please come up with a fixed version and I'll publish it.

@IlyaSemenov IlyaSemenov changed the title Bug demo exemples with-apollo with-apollo example is outdated Oct 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants