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

Replace Graphcool with a working GraphQL endpoint in with-apollo-and-redux example #19248

Merged
merged 4 commits into from Dec 2, 2020

Conversation

cascandaliato
Copy link
Contributor

The example stopped working when the GraphQL service Graphcool shut down in July. I have replaced it with an Hasura endpoint.

Fixes #19093

@ijjk ijjk added the examples Issue/PR related to examples label Nov 17, 2020
@ijjk
Copy link
Member

ijjk commented Nov 17, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
buildDuration 15.3s 14.2s -1s
nodeModulesSize 85 MB 85 MB
Page Load Tests Overall increase ✓
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
/ failed reqs 0 0
/ total time (seconds) 2.747 2.707 -0.04
/ avg req/sec 910.23 923.63 +13.4
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.685 1.619 -0.07
/error-in-render avg req/sec 1483.82 1544.04 +60.22
Client Bundles (main, webpack, commons)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..776c.js gzip 12.7 kB 12.7 kB
framework.HASH.js gzip 39 kB 39 kB
main-e1cf8de..941b.js gzip 6.53 kB 6.53 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.9 kB 58.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..dule.js gzip 8.26 kB 8.26 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-30e5038..dule.js gzip 5.64 kB 5.64 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.6 kB 53.6 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-3b0cf13..85f8.js gzip 1.28 kB 1.28 kB
_error-6f635..c393.js gzip 3.44 kB 3.44 kB
hooks-d4ffc3..9e0f.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-b618194..5477.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Pages Modern
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-f2fcc..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-9741e7f..dule.js gzip 1.55 kB 1.55 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.64 kB 5.64 kB
Client Build Manifests
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_buildManifest.js gzip 321 B 321 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 650 B 650 B
Rendered Page Sizes
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
index.html gzip 967 B 967 B
link.html gzip 975 B 975 B
withRouter.html gzip 960 B 960 B
Overall change 2.9 kB 2.9 kB

Serverless Mode
General
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
buildDuration 16.3s 17s ⚠️ +625ms
nodeModulesSize 85 MB 85 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..776c.js gzip 12.7 kB 12.7 kB
framework.HASH.js gzip 39 kB 39 kB
main-e1cf8de..941b.js gzip 6.53 kB 6.53 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.9 kB 58.9 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..dule.js gzip 8.26 kB 8.26 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-30e5038..dule.js gzip 5.64 kB 5.64 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.6 kB 53.6 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-3b0cf13..85f8.js gzip 1.28 kB 1.28 kB
_error-6f635..c393.js gzip 3.44 kB 3.44 kB
hooks-d4ffc3..9e0f.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-b618194..5477.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Pages Modern
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-f2fcc..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-9741e7f..dule.js gzip 1.55 kB 1.55 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.64 kB 5.64 kB
Client Build Manifests
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_buildManifest.js gzip 321 B 321 B
_buildManife..dule.js gzip 329 B 329 B
Overall change 650 B 650 B
Serverless bundles
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_error.js 918 kB 918 kB
404.html 4.61 kB 4.61 kB
hooks.html 3.86 kB 3.86 kB
index.js 918 kB 918 kB
link.js 977 kB 977 kB
routerDirect.js 969 kB 969 kB
withRouter.js 969 kB 969 kB
Overall change 4.76 MB 4.76 MB
Commit: 26cda98

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@cascandaliato Hi there and thank you for the PR 👋

Let's use the API that's being used in the with-apollo example: https://github.com/vercel/next.js/blob/canary/examples/with-apollo/lib/apolloClient.js#L14

@vercel vercel bot temporarily deployed to Preview November 26, 2020 08:20 Inactive
@ijjk
Copy link
Member

ijjk commented Nov 26, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
buildDuration 10.4s 10.2s -183ms
nodeModulesSize 85 MB 85 MB
Page Load Tests Overall increase ✓
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
/ failed reqs 0 0
/ total time (seconds) 2.322 2.382 ⚠️ +0.06
/ avg req/sec 1076.54 1049.51 ⚠️ -27.03
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.392 1.352 -0.04
/error-in-render avg req/sec 1796.1 1848.8 +52.7
Client Bundles (main, webpack, commons)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
buildDuration 12.4s 12s -397ms
nodeModulesSize 85 MB 85 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-90b3d5a..55ad.js gzip 6.54 kB 6.54 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_error.js 996 kB 996 kB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 996 kB 996 kB
link.js 1.05 MB 1.05 MB
routerDirect.js 1.04 MB 1.04 MB
withRouter.js 1.04 MB 1.04 MB
Overall change 5.13 MB 5.13 MB
Commit: 3f04a79

@cascandaliato cascandaliato changed the title Replace Graphcool with Hasura in with-apollo-and-redux example Replace Graphcool with a working GraphQL endpoint in with-apollo-and-redux example Nov 26, 2020
@cascandaliato
Copy link
Contributor Author

cascandaliato commented Nov 26, 2020

@lfades, done.

I have aligned most of the code to the with-apollo example.

I have kept the change to merge in lib/apollo.js#L38 because it fixes an issue where any client-side navigation leads to duplicate records in the Apollo cache (demo). The same problem exists in with-apollo. I'm not familiar with this library so I'm sure there are cleaner solutions.

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you @cascandaliato !

@vercel vercel bot temporarily deployed to Preview December 2, 2020 19:25 Inactive
@ijjk
Copy link
Member

ijjk commented Dec 2, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
buildDuration 10.1s 10.2s ⚠️ +22ms
nodeModulesSize 82.3 MB 82.3 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
/ failed reqs 0 0
/ total time (seconds) 2.057 2.027 -0.03
/ avg req/sec 1215.33 1233.13 +17.8
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.212 1.314 ⚠️ +0.1
/error-in-render avg req/sec 2063.31 1902.16 ⚠️ -161.15
Client Bundles (main, webpack, commons)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-3c9ff84..1d7c.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
index.html gzip 614 B 614 B
link.html gzip 620 B 620 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
buildDuration 12s 12s ⚠️ +64ms
nodeModulesSize 82.3 MB 82.3 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
677f882d2ed8..8b6e.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-3c9ff84..1d7c.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 8.01 kB 8.01 kB
Client Build Manifests
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary cascandaliato/next.js fix-with-apollo-and-redux Change
_error.js 997 kB 997 kB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 998 kB 998 kB
link.js 1.05 MB 1.05 MB
routerDirect.js 1.04 MB 1.04 MB
withRouter.js 1.04 MB 1.04 MB
Overall change 5.14 MB 5.14 MB
Commit: 3f86a72

@kodiakhq kodiakhq bot merged commit 2094961 into vercel:canary Dec 2, 2020
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With-apollo-and-redux - Error: Unexpected token < in JSON at position 0
3 participants