Giter VIP home page Giter VIP logo

graphql-apollo-next.js's People

Contributors

tomanagle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

graphql-apollo-next.js's Issues

Trying to reproduce and getting "Cannot read property 'req' of undefined"

I'm cloned and tested you repository, it works well, thanks for that!

I'm beginning a new Next.js project and I used to use HOC for GraphQL, but this new way seems better indeed. But when I try to apply what you did, I get the following:

Cannot read property 'req' of undefined
TypeError: Cannot read property 'req' of undefined
    at /Users/vadorequest/dev/TFP/node_modules/next-with-apollo/lib/withApollo.js:109:43
    at step (/Users/vadorequest/dev/TFP/node_modules/next-with-apollo/lib/withApollo.js:56:23)
    at Object.next (/Users/vadorequest/dev/TFP/node_modules/next-with-apollo/lib/withApollo.js:37:53)
    at /Users/vadorequest/dev/TFP/node_modules/next-with-apollo/lib/withApollo.js:31:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/vadorequest/dev/TFP/node_modules/next-with-apollo/lib/withApollo.js:27:12)
    at Function._a.getInitialProps (/Users/vadorequest/dev/TFP/node_modules/next-with-apollo/lib/withApollo.js:103:61)
    at loadGetInitialProps (/Users/vadorequest/dev/TFP/.next/server/static/development/pages/_document.js:530:33)
    at Function.<anonymous> (/Users/vadorequest/dev/TFP/.next/server/static/development/pages/_app.js:2154:58)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/vadorequest/dev/TFP/.next/server/static/development/pages/_document.js:217:24)
    at _next (/Users/vadorequest/dev/TFP/.next/server/static/development/pages/_document.js:239:9)
    at /Users/vadorequest/dev/TFP/.next/server/static/development/pages/_document.js:246:7
    at new Promise (<anonymous>)
    at new F (/Users/vadorequest/dev/TFP/node_modules/core-js/library/modules/_export.js:36:28)
    at Function.<anonymous> (/Users/vadorequest/dev/TFP/.next/server/static/development/pages/_document.js:235:12)

Here is a diff between my older version (HOC) and the new one (hooks):
https://diffy.org/diff/ob877mfdeqeix8r487s3jtt9

Not directly related to the issue, but one of the reason why I wanted to update my existing code is that I figured that my app isn't doing SSR at all, I wonder if that's related to the <ApolloProvider client={apollo}>, I didn't wrap my app in an ApolloProvider.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.