This is a Next.js project bootstrapped with create-next-app
.
git clone https://github.com/balintkiraly/next-ts-apollo-starter
yarn install
The generator script will run automaticly after the install
yarn dev
Open http://localhost:3000 with your browser to see the result.
- Create a new file in the
src/graphql
folder with.graphql
extension. - Simply write your query/mutation in the file
Always use a name like in the example
query CharactersList {
...
}
yarn generate
It will create a new file next to your graphql file with .generated.ts
extension.
You can simpli import the hook from the generated file.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.