Skip to content

An opinionated starter based with `code-first` economy and containerized for cloud deployments.

Notifications You must be signed in to change notification settings

sinhaGuild/pg-nexus-ts-gql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TS - GRAPHQL - APOLLO-SERVER - NEXUS - PRISMA


GraphQL Server Example with express-graphql

This example shows how to implement a GraphQL server with TypeScript with the following stack:

Contents

Getting started

1. Download example and install dependencies

Download this example:

curl -LJO 'https://github.com/sinhaGuild/pg-nexus-ts-gql/archive/refs/heads/main.zip'

Install npm dependencies:


cd api
yarn install
yarn run dev
Alternative: Clone the entire repo

Clone this repository:

git clone git@github.com:sinhaGuild/pg-nexus-ts-gql.git --depth=1

Install npm dependencies:

cd api/
yarn install

2. Create and seed the database

Run the following command to create your SQLite database file. This also creates the User and Post tables that are defined in prisma/schema.prisma:

npx prisma migrate dev --name init

When npx prisma migrate dev is executed against a newly created database, seeding is also triggered. The seed file in prisma/seed.ts will be executed and your database will be populated with the sample data.

3. Start the GraphQL server

Launch your GraphQL server with this command:

yarn run dev

Navigate to http://localhost:4000 in your browser to explore the API of your GraphQL server in a GraphQL Playground.

pg-nexus-ts-gql

About

An opinionated starter based with `code-first` economy and containerized for cloud deployments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published