Commit graph

11 commits

Author SHA1 Message Date
Charly POLY
ec94e68cc7
examples(with-routes-graphql): update GraphQL Yoga to v3 (#41478)
Update the `with-routes-graphql` example to [GraphQL Yoga](https://www.the-guild.dev/graphql/yoga-server/) new major ([migration guide](https://www.the-guild.dev/graphql/yoga-server/v3/migration/migration-from-yoga-v2)).
2022-10-17 17:13:48 +00:00
Max Proske
bb0013f5fa
chore(examples): Convert api-routes-graphql example to TypeScript (#38357)
Convert `api-routes-graphql` example to TypeScript to match Contribution docs.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm lint`
- [X] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-08 11:44:39 +00:00
Charly POLY
874957e767
feat(examples): refactor api-routes-graphql to GraphQL Yoga (#36155)
GraphQL Yoga provides a more extensible experience ([Envelop plugins](https://envelop.dev/)) and lighter bundle than the previously showcased `apollo-server-micro` ([64.5kB](https://bundlephobia.com/package/@graphql-yoga/node@2.2.1) vs [196.2kB](https://bundlephobia.com/package/apollo-server-micro@3.6.7) - min & GZiped)

Similar to Next.js, GraphQL Yoga comes with strong defaults and out-of-the-box support for modern GraphQL features (File uploads, subscriptions, and more).

Strong of many years of existence and a large community, GraphQL Yoga 2.0 comes with Next.js support with no additional package or configuration 📦 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-23 16:27:41 +00:00
Oscar Busk
077097b7f8
Remove licence from all example/package.json that has them (#28007)
* Add licences to all example/package.json that lack them

* Revert "Add licences to all example/package.json that lack them"

This reverts commit 5d4e25012f7334772b8ef5924bc355277e827cba.

* Update check-examples to remove `license` field from examples

* Remove `license` from all examples.

This was mentioned in vercel/next.js#27121 but it looks like it didn't end up being in the merge?

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-14 10:48:39 -05:00
Mahmoud Abdelwahab
c3884e6837
Update graphql example (#27334)
## Documentation / Examples

This is an update to the [GraphQL example](https://github.com/vercel/next.js/tree/canary/examples/api-routes-graphql) to use [apollo server 3](https://www.apollographql.com/docs/apollo-server). This example works with Apollo Studio
2021-07-20 15:19:22 +00:00
Luc Leray
f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00:00
Nick Babcock
5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
Luis Alvarez D
1eefd006a8
[example] Add SWR to api-routes-graphql (#11383)
* Updated example

* Removed isomorphic-unfetch
2020-04-07 09:51:02 -04:00
Joe Haddad
f152c745da
Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
Lukáš Huvar
a6c7ab9776
Example for GraphQL server with API routes (#7804)
* Example for GraphQL server with API routes

* Update examples/api-routes-graphql/pages/index.js

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>
2019-07-09 00:37:51 +02:00