rsnext/examples/with-graphql-hooks
2022-10-30 21:00:45 +01:00
..
components Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
lib fix(examples): Update nextjs-graphql-with-prisma-simple example API endpoint (#32759) 2021-12-23 15:32:07 +00:00
pages fix(examples): make with-graphql-hooks run correctly again (#20929) 2021-01-11 13:55:18 +00:00
.gitignore Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
package.json Update Examples to use React 18 (#42027) 2022-10-28 17:43:20 +00:00
README.md docs(examples): improve DX while copying command to create new project (#38410) 2022-07-26 21:57:48 -05:00
styles.css fix(examples): make with-graphql-hooks run correctly again (#20929) 2021-01-11 13:55:18 +00:00

GraphQL Hooks Example

GraphQL Hooks is a library from NearForm that intends to be a minimal hooks-first GraphQL client. Providing a similar API to Apollo.

You'll see this shares the same graph.cool backend as the Apollo example, this is so you can compare the two side by side. The app itself should also look identical.

This started life as a copy of the with-apollo example. We then stripped out Apollo and replaced it with graphql-hooks. This was mostly as an exercise in ensuring basic functionality could be achieved in a similar way to Apollo. The bundle size of graphql-hooks is tiny in comparison to Apollo and should cover a fair amount of use cases.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example with-graphql-hooks with-graphql-hooks-app
yarn create next-app --example with-graphql-hooks with-graphql-hooks-app
pnpm create next-app --example with-graphql-hooks with-graphql-hooks-app

Deploy it to the cloud with Vercel (Documentation).