Sample Apollo server for studying backend GraphQL server.
More high-level implementation is located here (Sorry for a private repository). Therefore, there will be no updates here.
Language - TypeScript
Main Framework - Apollo Server
ORM - Prisma
Database - PostgreSQL
GraphQL Schema Definition - GraphQL Nexus
Code Formatting - Prettier
Linting - ESLint
Add following environments
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
NODE_VERSION=18.17.1
PORT=4000
Build command
pnpm build
Start command
pnpm start
Use docker
docker compose --profile app up -d
git clone https://github.com/s-hirano-ist/rss-dumper-graphql.git
cd rss-dumper-graphql
docker compose up --build -d
pnpm i
pnpm prisma:dev
/api/graphql
: graphQL endpoint
- Schema of "News" is defined by nexus-prisma (preferred)
- Schema of "NewsDetail" is defined hardcode
mutation {
register(
email: "example@gmail.com"
password: "PASSWORD"
name: "Example Taro"
) {
token
}
}
mutation {
login(email: "example@gmail.com", password: "PASSWORD") {
token
}
}
query Query {
allNews {
heading
description
}
me {
email
admin
}
allUsers {
email
id
name
admin
}
}
gh release create --generate-notes
https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql-nexus
https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql-auth