Commit b990b29d authored by Tim Phillips's avatar Tim Phillips Committed by Tim Neutkens

Update Apollo links in examples (#4933)

parent d1b67623
...@@ -54,7 +54,7 @@ export default ComposedComponent => { ...@@ -54,7 +54,7 @@ export default ComposedComponent => {
} catch (error) { } catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR. // Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop: // Handle them in components via the data.error prop:
// http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error
} }
// getDataFromTree does not call componentWillUnmount // getDataFromTree does not call componentWillUnmount
// head side effect therefore need to be cleared manually // head side effect therefore need to be cleared manually
......
...@@ -7,13 +7,13 @@ export default () => ( ...@@ -7,13 +7,13 @@ export default () => (
<article> <article>
<h1>The Idea Behind This Example</h1> <h1>The Idea Behind This Example</h1>
<p> <p>
<a href='http://dev.apollodata.com'>Apollo</a> is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server. <a href='https://www.apollographql.com/client/'>Apollo</a> is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server.
</p> </p>
<p> <p>
In this simple example, we integrate Apollo seamlessly with <a href='https://github.com/zeit/next.js'>Next</a> by wrapping our pages inside a <a href='https://facebook.github.io/react/docs/higher-order-components.html'>higher-order component (HOC)</a>. Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application. In this simple example, we integrate Apollo seamlessly with <a href='https://github.com/zeit/next.js'>Next</a> by wrapping our pages inside a <a href='https://facebook.github.io/react/docs/higher-order-components.html'>higher-order component (HOC)</a>. Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
</p> </p>
<p> <p>
On initial page load, while on the server and inside getInitialProps, we invoke the Apollo method, <a href='http://dev.apollodata.com/react/server-side-rendering.html#getDataFromTree'>getDataFromTree</a>. This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized. On initial page load, while on the server and inside getInitialProps, we invoke the Apollo method, <a href='https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree'>getDataFromTree</a>. This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
</p> </p>
<p> <p>
This example relies on <a href='http://graph.cool'>graph.cool</a> for its GraphQL backend. This example relies on <a href='http://graph.cool'>graph.cool</a> for its GraphQL backend.
......
...@@ -54,7 +54,7 @@ export default ComposedComponent => { ...@@ -54,7 +54,7 @@ export default ComposedComponent => {
} catch (error) { } catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR. // Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop: // Handle them in components via the data.error prop:
// http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error
} }
// getDataFromTree does not call componentWillUnmount // getDataFromTree does not call componentWillUnmount
// head side effect therefore need to be cleared manually // head side effect therefore need to be cleared manually
...@@ -87,4 +87,4 @@ export default ComposedComponent => { ...@@ -87,4 +87,4 @@ export default ComposedComponent => {
) )
} }
} }
} }
\ No newline at end of file
...@@ -46,11 +46,11 @@ now ...@@ -46,11 +46,11 @@ now
This is an extention of the _[with Apollo](https://github.com/zeit/next.js/tree/master/examples/with-apollo#the-idea-behind-the-example)_ example: This is an extention of the _[with Apollo](https://github.com/zeit/next.js/tree/master/examples/with-apollo#the-idea-behind-the-example)_ example:
> [Apollo](http://dev.apollodata.com) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server. > [Apollo](https://www.apollographql.com/client/) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server.
> >
> In this simple example, we integrate Apollo seamlessly with Next by wrapping our *pages* inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application. > In this simple example, we integrate Apollo seamlessly with Next by wrapping our *pages* inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
> >
> On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](http://dev.apollodata.com/react/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized. > On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
> >
> This example relies on [graph.cool](https://www.graph.cool) for its GraphQL backend. > This example relies on [graph.cool](https://www.graph.cool) for its GraphQL backend.
> >
......
...@@ -54,7 +54,7 @@ export default App => { ...@@ -54,7 +54,7 @@ export default App => {
} catch (error) { } catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR. // Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop: // Handle them in components via the data.error prop:
// http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error
console.error('Error while running `getDataFromTree`', error) console.error('Error while running `getDataFromTree`', error)
} }
......
...@@ -44,10 +44,10 @@ now ...@@ -44,10 +44,10 @@ now
## The idea behind the example ## The idea behind the example
[Apollo](http://dev.apollodata.com) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server. [Apollo](https://www.apollographql.com/client/) is a GraphQL client that allows you to easily query the exact data you need from a GraphQL server. In addition to fetching and mutating data, Apollo analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run, fetching more results from the server.
In this simple example, we integrate Apollo seamlessly with Next by wrapping our *pages/_app.js* inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application. In this simple example, we integrate Apollo seamlessly with Next by wrapping our *pages/_app.js* inside a [higher-order component (HOC)](https://facebook.github.io/react/docs/higher-order-components.html). Using the HOC pattern we're able to pass down a central store of query result data created by Apollo into our React component hierarchy defined inside each page of our Next application.
On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](http://dev.apollodata.com/react/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized. On initial page load, while on the server and inside `getInitialProps`, we invoke the Apollo method, [`getDataFromTree`](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree). This method returns a promise; at the point in which the promise resolves, our Apollo Client store is completely initialized.
This example relies on [graph.cool](https://www.graph.cool) for its GraphQL backend. This example relies on [graph.cool](https://www.graph.cool) for its GraphQL backend.
...@@ -30,7 +30,7 @@ export default (App) => { ...@@ -30,7 +30,7 @@ export default (App) => {
} catch (error) { } catch (error) {
// Prevent Apollo Client GraphQL errors from crashing SSR. // Prevent Apollo Client GraphQL errors from crashing SSR.
// Handle them in components via the data.error prop: // Handle them in components via the data.error prop:
// http://dev.apollodata.com/react/api-queries.html#graphql-query-data-error // https://www.apollographql.com/docs/react/api/react-apollo.html#graphql-query-data-error
console.error('Error while running `getDataFromTree`', error) console.error('Error while running `getDataFromTree`', error)
} }
......
...@@ -7,7 +7,7 @@ export default () => ( ...@@ -7,7 +7,7 @@ export default () => (
<article> <article>
<h1>The Idea Behind This Example</h1> <h1>The Idea Behind This Example</h1>
<p> <p>
<a href='http://dev.apollodata.com'>Apollo</a> is a GraphQL client that <a href='https://www.apollographql.com/client/'>Apollo</a> is a GraphQL client that
allows you to easily query the exact data you need from a GraphQL allows you to easily query the exact data you need from a GraphQL
server. In addition to fetching and mutating data, Apollo analyzes your server. In addition to fetching and mutating data, Apollo analyzes your
queries and their results to construct a client-side cache of your data, queries and their results to construct a client-side cache of your data,
...@@ -27,7 +27,7 @@ export default () => ( ...@@ -27,7 +27,7 @@ export default () => (
<p> <p>
On initial page load, while on the server and inside getInitialProps, we On initial page load, while on the server and inside getInitialProps, we
invoke the Apollo method,{' '} invoke the Apollo method,{' '}
<a href='http://dev.apollodata.com/react/server-side-rendering.html#getDataFromTree'> <a href='https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree'>
getDataFromTree getDataFromTree
</a>. This method returns a promise; at the point in which the promise </a>. This method returns a promise; at the point in which the promise
resolves, our Apollo Client store is completely initialized. resolves, our Apollo Client store is completely initialized.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment