create-next-apollo
v2.1.1
Published
create-next-apollo
Downloads
15
Maintainers
Readme
Create-Next-Apollo
npm i -g create-next-apollo
create-next-apollo myAppName
or
npx create-next-apollo myAppName
Instruction
It is ready to use, it comes with simple example that shows you:
- How to use Unstated to share state across pages.
- How to SSR Apollo in Next
- How to environment variable (inject with env-cmd and get it from next.config.js)
- How to preserve Unstated from server to client
Out of the box:
- CSS import support
- Image import support
- Sass import support
What can you expect when you npm run dev?
The data is loaded together with the page which mean SSR is working.
You should see nothing in about page because you haven't updated the state in container.
Now go back and update the state in index page.
And now you should see the same data in About page.
Troubleshooting
ENOENT error when npm i -g create-next-apollo in desktop folder
cause: unknown
remedy: there is three workaround, download and install new version of npm or npx create-next-apollo myAppName or create a new folder and run npm i -g create-next-apollo in the folder
Acknowledgement
Greatly Inspired by Next Apollo Example
Misc
Great library, deserve more attention Unstated
This project was bootstrapped with Create NPM Create.