Skip to content

matthewspear/drizzle-graphql-postgres-starter

Repository files navigation

Drizzle GraphQL Postgres API Example

This example starts an drizzle-graphql server written in TypeScript.

Deploy on Railway

✨ Features

  • Drizzle
  • GraphQL
  • TypeScript

💁‍♀️ How to use

  • Install dependencies pnpm i
  • Connect to your Railway project railway link
  • Start the development server railway run pnpm dev

📝 Notes

To launch a local instance of Postgres for testing run docker compose up

When setting up a database for the first time run pnpm db:push to create the database schema.

To use the GraphiQL interface head to /graphql on your local or hosted domain. Below are some operations to try out:

Creating a user:

mutation {
  insertIntoUsers(values: { name: "Matt" }) {
    id
    name
  }
}

Creating a post:

mutation {
  insertIntoPosts(values: { authorId: 1, content: "Hello world!" }) {
    id
    content
    authorId
  }
}

Querying the user and posts:

query {
  users {
    id
    name
    posts {
      id
      content
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published