Commit graph

12 commits

Author SHA1 Message Date
Steven
4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
Valentin Politov
9168dffc02
examples: Bump SWR to v2.0.0 (#44790) 2023-01-12 09:36:29 -08:00
Arda TANRIKULU
00d7a35ed7
Use the stable GraphQL Yoga v3 in the GraphQL example (#44488)
Use the stable GraphQL Yoga v3 in the GraphQL example, and also disable body parser for fully functionality as in GraphQL Yoga's recipe for Next.js;
https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-nextjs#example


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-01-03 00:53:12 +00:00
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
Mahmoud Abdelwahab
f657e09b53
Fix CORS issue in GraphQL example that prevented Apollo Studio from working (#27486)
Update example so Apollo Studio works properly
2021-07-25 21:47:04 +00: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
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -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
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
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