Pull request Compare This branch is 89 commits behind canary.
Skaronator and timneutkens Added note for AWSAppSyncClient (#4611)
I had some trouble to get server side rendering with the AWSAppSyncClient working. I finally found a solution in awslabs/aws-mobile-appsync-sdk-js#82 but it might be worth to share it here as well. Instead of adding a big code block to each file I'll just refer to this Pull Request.

______

In case you want to use the `AWSAppSyncClient` you just need to replace the `create()` function with this function:
```jsx
import AWSAppSyncClient from 'aws-appsync';
import { AUTH_TYPE } from 'aws-appsync/lib/link/auth-link';

function create(initialState) {
  const client = new AWSAppSyncClient({
    url: AWS_AppSync.graphqlEndpoint,
    region: AWS_AppSync.region,
    auth: {
      type: AUTH_TYPE.API_KEY,
      apiKey: AWS_AppSync.apiKey,

      // Amazon Cognito Federated Identities using AWS Amplify
      //credentials: () => Auth.currentCredentials(),

      // Amazon Cognito user pools using AWS Amplify
      // type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS,
      // jwtToken: async () => (await Auth.currentSession()).getIdToken().getJwtToken(),
    },
    disableOffline: true,
  }, {
    cache: new InMemoryCache().restore(initialState || {}),
    ssrMode: true
  });

  return client;
}
```
Latest commit dde20fc Jun 29, 2018
Permalink
..
Failed to load latest commit information.
active-class-name Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
basic-css Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
basic-export Add basic export example May 2, 2018
custom-charset Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-actionhero Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-express Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-fastify Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-hapi Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-koa Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-micro Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-nodemon Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-polka Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
custom-server-typescript Update typescript examples to use 1.0.1 of next-typescript (#4472) May 25, 2018
custom-server Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
data-fetch Fix class name in data-fetch example (#4358) May 13, 2018
form-handler Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
gh-pages Upgrade gh-pages example to next 6.0.3 (#4575) Jun 10, 2018
head-elements Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
hello-world Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
layout-component Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
nested-components Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
only-client-render-external-dependencies Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
page-transitions Remove page-transitions example May 25, 2018
parameterized-routing Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
pass-server-data Update pass-server-data example [ci skip] (#4362) May 13, 2018
progressive-render Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
root-static-files Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
shared-modules Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
ssr-caching Update ssr-caching example (#4363) May 13, 2018
svg-components Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
using-inferno Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
using-nerv Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
using-preact fix(examples/using-preact): use latest next-preact (#4152) Apr 14, 2018
using-router Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
using-with-router Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-absolute-imports Update with-absolute-imports example to Babel 7 (#4610) Jun 15, 2018
with-algolia-react-instantsearch Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-amp stop duplicating charset (#4546) Jun 6, 2018
with-ant-design-less Added example for Ant Design with LESS (#4520) Jun 7, 2018
with-ant-design Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-antd-mobile Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-aphrodite Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-apollo-and-redux-saga Added note for AWSAppSyncClient (#4611) Jun 29, 2018
with-apollo-and-redux Added note for AWSAppSyncClient (#4611) Jun 29, 2018
with-apollo-auth Added note for AWSAppSyncClient (#4611) Jun 29, 2018
with-apollo Added note for AWSAppSyncClient (#4611) Jun 29, 2018
with-app-layout Add _app layout example Apr 24, 2018
with-asset-imports Update with-asset-imports [ci skip] (#4365) May 13, 2018
with-babel-macros Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-cerebral Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-componentdidcatch Fix and improve example : with-componentdidcatch (#4400) May 18, 2018
with-configured-preset-env Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-custom-babel-config Fix example with-custom-babel-config: update to Babel 7 (#4349) May 12, 2018
with-custom-reverse-proxy Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-cxs Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-data-prefetch Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-docker Update package.json in with-docker example (#4359) May 13, 2018
with-dotenv Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-draft-js Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-dynamic-import Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-electron Update with-electron example (#4386) May 16, 2018
with-emotion-fiber Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-emotion Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-external-scoped-css Deprecate css examples Jan 31, 2018
with-fela Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-firebase-authentication Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-firebase-hosting-and-typescript Update typescript examples to use 1.0.1 of next-typescript (#4472) May 25, 2018
with-firebase-hosting with-firebase-hosting: fix npm scripts, remove firebase.json predeplo… Jun 12, 2018
with-flow Add eslint parser to avoid errors in IDE. (#4297) May 7, 2018
with-freactal Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-glamor Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-glamorous Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-global-stylesheet-simple Update README in with-global-stylesheet-simple [ci skip] (#4361) May 13, 2018
with-global-stylesheet Update babel-plugin-module-resolver version in with-global-stylesheet ( May 13, 2018
with-google-analytics Add with-google-analytics example (#4036) Mar 29, 2018
with-hashed-statics Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-higher-order-component Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-i18next Fix "with-i18next" example (#4393) May 16, 2018
with-immutable-redux-wrapper Add Example of Redux Wrapper with Immutable.js (#4327) May 10, 2018
with-ioc Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-jest-typescript Upgrade with-jest-typescript example to next 6.0.0 (#4543) Jun 6, 2018
with-jest [with-jest] Move jest deps to devDeps (#4650) Jun 22, 2018
with-kea Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-loading Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-markdown Update with-markdown example (#4612) Jun 15, 2018
with-material-ui 📝️Restructure `with-material-ui` per #4439 (#4444) May 21, 2018
with-mobx-state-tree Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-mobx Fix with-mobx example (#4394) May 16, 2018
with-next-css Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-next-less Add with-next-less example (#4492) May 29, 2018
with-next-page-transitions Add example with next-page-transitions (#4404) May 17, 2018
with-next-routes Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-next-sass Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-noscript Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-now-env Prevent now-env from running in production (#4259) May 5, 2018
with-pkg fix(with-pkg): update pkg config for next.js (#4307) May 8, 2018
with-polyfills Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-portals Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-prefetching Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-pretty-url-routing Add license section in with-pretty-url-routing [ci skip] (#4366) May 13, 2018
with-react-ga Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-react-helmet Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-react-i18next [with-react-i18next] Fix flickering on page change via <Link /> (#4318) May 9, 2018
with-react-intl fixes bug in with-react-intl example: messages and locale variables w… Jun 1, 2018
with-react-md Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-react-native-web added support flex: 1 and and tag support Dimensions (#4460) May 23, 2018
with-react-toolbox Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-react-uwp Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-react-with-styles Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-reasonml with-reasonml: better setup (#4218) Apr 27, 2018
with-rebass Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-recompose Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-redux-code-splitting Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-redux-observable Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-redux-reselect-recompose Merge branch 'canary' Apr 29, 2018
with-redux-saga Improve with-redux-saga example (#4392) May 16, 2018
with-redux-wrapper Support _app approach for upgraded Redux Wrapper (#4207) May 8, 2018
with-redux Clean up Redux example (#4594) Jun 13, 2018
with-reflux Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-refnux Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-relay-modern Relay modern example fixes (#4120) Apr 7, 2018
with-rematch Added example for usage with rematch (#4095) Apr 18, 2018
with-scoped-stylesheets-and-postcss Deprecate css examples Jan 31, 2018
with-segment-analytics Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-semantic-ui Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-sentry Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-shallow-routing Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-sitemap-and-robots-express-server sitemap.xml and robots.txt example (#4163) May 25, 2018
with-socket.io with-socket.io Example updated with _app.js (#4644) Jun 23, 2018
with-static-export Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-styled-components with-styled-components: Move babel plugin to dev dependency (#4602) Jun 14, 2018
with-styled-jsx-plugins Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-styled-jsx-postcss Make styled-jsx configurable (#3050) Oct 15, 2017
with-styled-jsx-scss Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-styletron Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-sw-precache Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-tailwindcss Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-typescript Update typescript examples to use 1.0.1 of next-typescript (#4472) May 25, 2018
with-universal-configuration-runtime Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-universal-configuration Update with-universal-configuration (#4624) Jun 17, 2018
with-unstated Added with-unstated example (#4628) Jun 19, 2018
with-url-object-routing Update with-url-object-routing (#4314) May 16, 2018
with-videojs added example of integration with videojs (#4139) Apr 12, 2018
with-webpack-bundle-analyzer Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-webpack-bundle-size-analyzer Examples: stabalise README format and create-next-app usage (#4009) Apr 3, 2018
with-zones fix README typo (#4476) May 26, 2018
.babelrc Add componentDidCatch example Apr 23, 2018
.gitignore Remove yarn.lock from examples (#912) Jan 29, 2017