Skip to content

atarikcaliskan/react-query-gql

Repository files navigation

React Query with Next.js Typescript & GQL Codegen

This project is a starter kit for a web application built using React Query, Next.js, Typescript, GraphQL Code Generator, and SSR (Server-Side Rendering). It also includes the capability to store cookies on the client and server.

React Query is a library that simplifies fetching, caching, and updating data in your React applications. Next.js is a popular framework for building server-rendered React applications. Typescript provides strong typing and error checking for your code, while GraphQL Code Generator generates type-safe and auto-completed GraphQL queries.

Features

  • React Query for easy fetching, caching, and updating of data
  • Next.js for server-side rendering and client-side routing
  • Typescript for strong typing and error checking
  • GraphQL Code Generator for generating type-safe and auto-completed GraphQL queries
  • Dehydrated state for server-side rendering of data
  • Cookies for client and server storage

Installation

  1. Clone the repository or download the ZIP file.
  2. Install the dependencies by running pnpm install.

Usage

Development

To start the development server, run pnpm dev.

Code Generation

This project uses GraphQL Code Generator to generate type-safe and auto-completed GraphQL queries. The configuration file for the generator is located in codegen.ts.

To generate the GraphQL types, run the following command:

pnpm generate

Contributing

Contributions are welcome. Please create an issue or a pull request for any bug fixes, enhancements, or new features.

About

React Query with Next.js Typescript & GQL Codegen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published