This example starts an drizzle-graphql server written in TypeScript.
- Drizzle
- GraphQL
- TypeScript
- Install dependencies
pnpm i
- Connect to your Railway project
railway link
- Start the development server
railway run pnpm dev
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
}
}
}