/gatsby-starter-typescript-graphql

A Gatsby starter with typesafe GraphQL using TypeScript

Primary LanguageTypeScriptMIT LicenseMIT

gatsby-starter-typescript-graphql

This is a starter kit for Gatsby.js websites written in TypeScript. It leverages GraphQL Code Generator to enable typesafe GraphQL queries.

Features

Setup

Install the Gatsby CLI

yarn global add gatsby-cli

Create a new site

gatsby new <PROJECT_NAME> https://github.com/spawnia/gatsby-starter-typescript-graphql

By default, this starter adds the GitHub GraphQL API as a source. This can be quite useful for personal sites or blogs to show off your projects.

To connect with the GitHub API, you will need to add a personal access token to your environment:

cp .env.development.example .env.example

If you do not want to try this feature, remove src/components/repositories.tsx and its usages.

Usage

Start a dev server

yarn start

Create a production build

yarn build

Serve the production build locally

yarn serve

Generate GraphQL type definitions

yarn codegen