Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laurabeatris/graphql-academy
Repository with all the code references from my workshop called "GraphQL Academy"
https://github.com/laurabeatris/graphql-academy
graphql
Last synced: 19 days ago
JSON representation
Repository with all the code references from my workshop called "GraphQL Academy"
- Host: GitHub
- URL: https://github.com/laurabeatris/graphql-academy
- Owner: LauraBeatris
- Created: 2021-11-13T15:56:53.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-09T20:06:31.000Z (over 2 years ago)
- Last Synced: 2024-10-11T10:48:10.811Z (about 1 month ago)
- Topics: graphql
- Language: TypeScript
- Homepage:
- Size: 384 KB
- Stars: 21
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL Academy
Simple GraphQL API to be used as a guidance from the topics covered on my workshop called "GraphQL Academy"
## Technologies
The goal of this workshop is not to suggest/advocate for specific GraphQL libraries, thus don't feel obliged of choosing
the same dependencies from this repo as the choices for your projectHowever, you can find the reasoning behind my choices [in this pull request](https://github.com/LauraBeatris/graphql-academy/pull/1)
## References by topic
Not every topic from the workshop will be referenced here, but I'll try as much as possible
to link implementations so that you can use as a basis for your personal project / challenges proposed on each class- [Initial GraphQL API setup with Apollo Server](https://github.com/LauraBeatris/graphql-academy/pull/1)
- [Schema implementation using TypeGraphQL (Annotation-based implementation)](https://github.com/LauraBeatris/graphql-academy/tree/main/src/graphql/schema)
- [Resolvers + data layer with Prisma](https://github.com/LauraBeatris/graphql-academy/pull/3)
- [Reproducing N+1 issue](https://github.com/LauraBeatris/graphql-academy/pull/4)
- [Mutations with payload, input types and error as data handling](https://github.com/LauraBeatris/graphql-academy/pull/6)
- [Pagination: Cursor & Offset styles](https://github.com/LauraBeatris/graphql-academy/pull/7)
- [Introduce interface type to decouple schema from the persistence layer](https://github.com/LauraBeatris/graphql-academy/pull/8)
- [Generate SDL artifact from code definitions](https://github.com/LauraBeatris/graphql-academy/pull/9)## Steps to run API locally
### Install dependencies
```bash
yarn install
```### Configure & migrate database
Make sure to have a Postgres database running in order to execute the migration script.
Create a .env file based on .env.example and update the variables according to your database configuration.```bash
cp .env.example .env
```
```env
PORT=3000
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/graphql-basis?schema=public"
```Run the `migrate-dev` script, which will migrate tables defined on [Prisma schema](./prisma/schema.prisma) and execute a [seed script](./prisma/seed.ts)
to populate some initial data in order to use the API locally
```bash
yarn migrate-dev
```
`
### Start the GraphQL server```
yarn dev
```