1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

20 commits

Author SHA1 Message Date
Tim Neutkens b6c8d2a4ac Merge branch 'canary'
# Conflicts:
#	package.json
2018-09-19 18:15:57 +02:00
Marcelo Zapaia ae7e53239a FIX with-apollo-auth example token access (#4771)
in some cases access to the token doesn't work in client side. this access to the token once in getInitialProps method and pass it down using props
2018-09-12 17:19:32 +02:00
Keith Grennan 8f61c335cb [with-apollo-auth] Only run getDataFromTree() on server (fix #4775) (#5112)
Though it sounds like some folks do run getDataFromTree() on the client in order to avoid loading states, it's non-standard usage and potentially confusing.  Also it's inconsistent with the other with-apollo examples.
2018-09-06 09:45:16 +02:00
HaNdTriX 5ff7c0742c Lint examples (#4985)
* Lint examples/with-apollo-and-redux-saga

* Lint examples/with-apollo-auth

* Lint examples/with-apollo

* Lint exampels/with-google-analytics

* Lint examples/with-higher-order-component

* Lint examples/with-react-i18next

* Lint exampels/with-redux

* Lint exampels/with-relay-modern

* Lint examples/with-universal-configuration-runtime

* Add **/examples/**/lib/** to linter
2018-08-20 08:31:24 +02:00
Tim Phillips b990b29d2d Update Apollo links in examples (#4933) 2018-08-09 14:00:08 -07:00
Niklas Wagner dde20fc841 Added note for AWSAppSyncClient (#4611)
I had some trouble to get server side rendering with the AWSAppSyncClient working. I finally found a solution in https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/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;
}
```
2018-06-29 10:08:26 +02:00
Brice BERNARD 7e8acf3a30 [with-apollo-auth] simplify apolloState prop (#4563)
We don't need `.data` as `apollo.cache.extract()` returns at least `{}` when cache is empty
2018-06-08 11:48:10 +02:00
Brice BERNARD e318de62c0 [with-apollo-auth] Remove useless check from constructor (#4560)
We don't pass apolloClient as props, so I removed the check as confusing and always false.

see https://github.com/zeit/next.js/blob/canary/examples/with-apollo-auth/lib/withApollo.js#L72-L75

Again please explain me if I am wrong :)
2018-06-08 10:27:31 +02:00
Brice BERNARD 1a8bdba56b [with-apollo-auth] Remove useless apolloState from App's props (#4554)
App component does not need/use apolloState prop, so let's remove it. If I'm wrong please explain me the purpose of this.
2018-06-08 08:54:19 +02:00
Luis Fernando Alvarez D 2ef80a354c Fixed error with the cookie parser in with-apollo-auth (#4445)
Fixes #4442
2018-05-21 21:51:00 +02:00
Luis Fernando Alvarez D 915673fcd6 Example updated: with-apollo-auth to Next 6 (#4420) 2018-05-18 10:55:12 +02:00
Yuri Yakovlev 59aa5a4dde Return empty string instead of null in the Authorization (#4389)
I was unable to make right check of `authorization` in the header on GraphQL side because now it returns `null` as string instead of empty string
2018-05-16 12:09:23 +02:00
Tage A. L. K b321e6e942 Remove deprected and refactor with-apollo-auth (#4070)
* Remove deprected use of apollo-client-preset, and refactor

Changes
* Remove deprected use of apollo-client-preset in favor of apollo-boost
* Refactor for usage of react-apollo@2.1

* Use standard

Just ran standard --fix
2018-03-31 08:11:36 +02:00
Tage A. L. K c6d9ab7563 with-apollo-auth updated for Apollo 2.0 (#3278)
* Updated for Apollo 2.0

* Updated for commit: ccb188a

* Simplified serverState

Updated with danistefanovic's comment. Looks better.

* Revert "Simplified serverState"

This reverts commit 1b543a35909dcfe401c753cb2f71760180087057.

* Simplified server

Updated with Statedanistefanovic's comment.
2017-11-17 08:23:52 +01:00
Tim Neutkens 6977d61ebe Merge branch 'master' into canary
# Conflicts:
#	.travis.yml
2017-11-15 13:20:46 +01:00
Divyendu Singh ccb188ab6b Update withData.js - support withRouter HOC (#3286)
Add support for using withRouter as HOC with this example.

Passing router context manually fixes this, based on, https://github.com/zeit/next.js/issues/2908#issuecomment-338244804
2017-11-15 10:44:06 +01:00
Tim Neutkens 18f8ab392a Merge branch 'master' into canary
# Conflicts:
#	examples/with-apollo/lib/initApollo.js
#	examples/with-apollo/package.json
#	examples/with-react-with-styles/package.json
#	examples/with-static-export/package.json
#	package.json
2017-11-05 11:01:59 +01:00
Leonardo Quixada b41d177609 Dropped isomorphic-fetch in examples in favor of isomorphic-unfetch. (#3230) 2017-11-04 15:05:16 +01:00
Kitti Piyapan 28767c06d1 Change file name lib on example keep the same format (#3227)
Change file name format on folder lib like /examples/with-apollo and /examples/with-apollo-and-redux
2017-11-02 17:56:14 +01:00
Jess Telford 4a0278b5c0 Apollo + Authentication + graph.cool example (#2161)
* Apollo + Authentication + graph.cool example

* Fix linting errors
2017-06-30 22:18:11 +02:00