-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work on examples/5-nextjs #93
Conversation
@zenflow this looks awesome! I've set aside time on Thursday for most-gql stuff so I'll get to this then (unless someone beats me to it) |
lgtm |
Added one commit
|
@zenflow this looks good to me as well! My thoughts on further building this out as a boilerplate: I'm torn on the best way to handle this. On one hand I think the examples should keep things as minimal and simple as possible so people can focus on just the That being said in either case I'm all for either including or linking to more extensive boilerplates or similar. I'd be happy to take my current stack (Prisma + nexus server) and build it out as a starter / example. For now I'm going to go ahead and merge this, but we can always add more to it later! |
The nextjs example was pretty minimal and seemed to need a little love, so I took the liberty of fixing it up and making it more of an example.
Before:
![image](https://user-images.githubusercontent.com/3198597/65076112-4c35da00-d966-11e9-8a2d-143f6e0c8270.png)
After:
![image](https://user-images.githubusercontent.com/3198597/65075839-a5e9d480-d965-11e9-9d25-b912a368f541.png)
mst-gql
cli seems to have been picking up anothermst-gql.config.js
file (the one inexamples/2-scaffolding
) and using that, (and erroring about a missinggraphql-schema.json
) so I created a correct one to be picked up./scripts/install-mst-gql.sh
does not exist anymore"scripts": {"postinstall": "../../node_modules/.bin/relative-deps"}
inpackage.json
same as other examplesisomorphic-fetch
dependencygetSnapshot
andapplySnapshot
when on server<MyApp>
give it thepageProps
prop that it normally gets (so we don't break use of page-levelgetInitialProps
)store
when calling the page'sgetInitialProps
so it could be used there, e.g. for pre-fetching datadoneTodos
queryassignee: User
property.This to me is now a good little sandbox to demo & play with this library working in an SSR setup. It demonstrates a few issues, including #91 and a couple others (relevant to SSR scenarios) I will be documenting shortly.
This 5-nextjs example could also serve as a decent little boilerplate for a mst-gql + nextjs + apollo app. There are some other enhancements to this end that I haven't yet ported from my personal repo of this (https://github.com/zenflow/mst-gql-next)
schema.js
localhost:3000
)Should I add them here? Or do you think these kinds of things should be out of scope for this example project? I think it would be great if we had a shared robust starting-point for this type of project.
Hope someone wants to merge this! If not, that's ok too 👍