Skip to content
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

Add an example with graphql-react #5984

Merged
merged 3 commits into from
Jan 9, 2019

Conversation

jaydenseric
Copy link
Contributor

Adds an example with graphql-react, using next-graphql-react.

graphql-react is a lightweight but powerful GraphQL client for React; the first Relay and Apollo alternative with server side rendering.

"dependencies": {
"cross-fetch": "^3.0.0",
"graphql-react": "^6.0.0",
"next": "^7.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably use latest like the other examples.

Copy link
Contributor Author

@jaydenseric jaydenseric Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the time I surveyed the examples and noticed about 17 don't use latest for the next dependency. This is a good thing, since examples are not guaranteed to work when (not if) breaking changes to next are published in a major version.

There are almost no valid use cases for * or latest. Inexperienced people that download and run examples locally are likely to use them as a boilerplate for their own projects, and they will not know that latest is risky anti-pattern that will eventually blow up their project.

When the next major version of next is published I will be sure to publish a new version of next-graphql-react that supports it, with an updated peer-dependency range, and update the dependency in the example here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing the major version of next supported by each example in package.json is also useful, as when a major new version is published not every example is guaranteed to work on day 1. It lets you know how up to date the example and the third-party projects are.

@jaydenseric
Copy link
Contributor Author

I've pulled in the latest from canary branch and fixed a Standard Style lint issue, so CI is passing now. Should be good to merge?

@timneutkens timneutkens merged commit eb24e6f into vercel:canary Jan 9, 2019
@timneutkens
Copy link
Member

Thanks!

@jaydenseric jaydenseric deleted the with-graphql-react branch January 9, 2019 09:25
rajendraarora16 added a commit to rajendraarora16/next.js that referenced this pull request Jan 10, 2019
Add an example with graphql-react (vercel#5984)
@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants