Skip to content

RossmacD/TS-GQL-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript GraphQl API Server

Apollo Server, GraphQL, Typescript and Postgres.

Getting Started

  1. Download & Install Dependencies

    # clone it
    $ git clone 
    $ cd apollo-typescript-starter
    
    # Make it your own
    $ rm -rf .git && git init
    
    # Install dependencies
    $ npm install
  2. Next, ensure your local Postgres database is up and running. Once configured, place your connection url in a .env file at the root of the repo. These variables will be automatically assigned to process.env when the application boots through dotenv. Your .env file should look something like this:

    DATABASE_URL=postgres://user@host/database
    
  3. Use knex to migrate the database using the migrations

    # Install knex globally if you don't already have it with 'npm install -g knex' 
    $ knex migrate:latest
    
    # Use knex migrate:rollback to  
  4. Boot the app and navigate to localhost:3000/graphiql to run a query!

    $ npm start

Resources

About

A graphQL API written in typescript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published