Commit graph

23 commits

Author SHA1 Message Date
Rich Haines
138361208c
Fixed duplicate data fetching overview page + links (#33774)
This PR removes the duplicate overview link for data fetching, and fixes the corresponding links

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-01-29 02:52:40 +00:00
Smit Barmase
74e0c6d6d8
with-apollo SSR example added. (#21956)
Co-authored-by: Lee Robinson <me@leerob.io>
2021-02-08 23:12:01 -06:00
Sung Hah Hwang
f186be6927
Update client-only.js (#19884)
typos
2020-12-08 02:29:00 +00:00
Yordis Prieto
1e3534e169
Add apollo state func (#19137)
The intention is to show people the correlation between things, in this case, understand the usage of the same key from the props and the rehydration.

Hopefully, this change will bring value as it has done with some Juniors already.
2020-11-15 23:04:22 +00:00
Omkar Yadav
bf9b96bd81
Update Apollo example for 9.5 (#15546) 2020-07-28 01:16:08 -04:00
Ruslan Dzyubanov
893e57d29e
Update examples/with-apollo (#15178)
apollo-client 2.6.8 -> 3.0.0
2020-07-15 18:23:22 +00:00
Luis Alvarez D
2d2c7626e3
[Examples] Move with-apollo to SSG (#13742)
Based on https://github.com/vercel/next.js/pull/13607 - I created a new PR as I can't push changes to the initial PR.

Migrated the Apollo client to use SSG, also removed the link to the live demo because I don't know who the owner is or how to update the deployment.

The implementation is pretty simple and will be added to all the other Apollo examples
2020-06-05 15:41:42 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Henrik Wenz
1a50d99fbd
Update withApollo example (#10451)
* Make withApollo work with _app.js components

* Support wrapping functional _App

* Add apolloClient to NextPageContext & NextPageContext

* Propertly call App.getInitialProps if used in NextAppContext

* Add Automatic Static Optimization warning

* Update deps

* Reduce API surface

* Move back to singleton client

* Improve documentation

* Remove Head.rewind()
We can get rid of .rewind by now as the latest next/head no longer uses legacy context.

* Add extra docs

* Reuse apolloState coming from previous hocs

Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-02-13 00:26:22 -05:00
Roman Ernst
c8e5f925a0
Make apollo HOC composable (#10422)
* Wraps config in higher-order function
2020-02-05 17:02:45 +01:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Henrik Wenz
cba5c05b36 Fix getInitialProps issue in with-apollo example (#8620)
* Fix getInitialProps in with-apollo example

The code before had two design flaws:

* When we skip WithApollo.getInitialProps we must hoist PageComponent.getInitialProps if it is present.
* We should expose the apolloClient to underlying PageComponent.getInitialProps contexts.

* Add abort check

* Add some comments

* Add client only example page

https://github.com/zeit/next.js/pull/8620#issuecomment-527870886

* Remove connectToDevTools setting in favor default config

7eaf4132cd/packages/apollo-client/src/ApolloClient.ts (L170-L173)

* Remove fetch check

This is done by https://www.npmjs.com/package/isomorphic-unfetch

* Remove apollo-boost

I am removing this package, because we never actually used it.
This is because we use the named export of apollo boost wich resolves to apollo-client.

This way we removed apollo-link-state, apollo-link-error

* Remove redirect code from the client
2019-09-04 11:46:39 -05:00
Henrik Wenz
78d274db9b Improve with-apollo example (#8508)
* Simplify apollo setup

* Allow disabling of ssr in favor of automatic static optimization

- Converted Class to Function Component
- Added ssr config option

* Exclude @apollo/react-ssr from client bundle

* Remove WithApollo.getInitialProps from the client

* Remove displayName from production build

* Fix production switch

* Change export & fucntion naming

- Use named export
- Change function naming

* Warn if someone tries to use this HOC with _app.js
2019-08-27 09:43:29 -05:00
Henrik Wenz
17b1154d9b Remove _app from with-apollo example (#8504)
* Remove _app from with-apollo example

This allows automatic static optimization for pages, that don’t need apollo.

* Rename with-apollo

Name should be same as hoc

* Adjust text to reflect latest changes

more info: 4321c469466160d13bcd52afa099385e84a112a0
2019-08-24 22:19:26 -04:00
Rafael Almeida
1765007a10 Update with-apollo example with hooks (#8363)
* Add @apollo/react-hooks and @apollo/react-ssr

* Migrate react-apollo to @apollo/react-hooks and Query component

* Migrate direct client mutations to useMutation hook

* Disable submit button when submiting a new post

* Fix Show More button not updating when loading more entries

* All queries with uppercase name

* Remove react-apollo

* Update getDataFromTree links

* Fixed lint issues
2019-08-14 15:00:34 -05:00
Tim Neutkens
a90a55545b
Deprecate Container usage (#8327)
* Remove Container from examples

* Update readme to reflect Container removal
2019-08-11 22:02:33 +02:00
Tim Neutkens
9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00
Tim Phillips
b990b29d2d Update Apollo links in examples (#4933) 2018-08-09 14:00:08 -07:00
Tim Neutkens
6c0091fb7a
Add new apollo example using _app.js (#4286)
* Add new apollo example

* Update readme

* Update with-apollo to use _app.js

* Move withData to _app

* Make SSR work again

* Remove withData

* Use HOC to provide apolloClient

* Spread pageprops
2018-05-07 15:02:56 +02:00
Brice BERNARD
35ffad968c [with-apollo] Fix missing rootContext (#3468) 2017-12-18 11:25:06 +01:00
Brice BERNARD
48ed89f93d [with-apollo] Fix warning about missing _allPostsMeta and more (#3397)
* Fix coding style

* Fix className type

* Upgrade deps

* Fix coding style of lib/

* Simplify onSubmit handler

* Fix missing missing _allPostsMeta warning

* Follow lint rules
2017-12-05 10:50:45 -08:00
Adam Soffer
4b257483e2 Add Apollo example (#780)
* Add minimal apollo example

* Update apollo example README

* Update apollo example demo link in README

* Fix button styles

* Fix show more button

* Alias demo url

* Include the data field on the Apollo store when hydrating

* Revert

* Include the data field on the Apollo store when hydrating per tpreusse's suggestion.

* Add example to faq section in README

* Sort by newest; Add active state to buttons

* Make optimization suggestions

* Use process.browser; inline props
2017-01-22 13:27:06 +01:00