Awesome
<img src="https://cdn.simpleicons.org/graphql" title="GraphQL Practice Repo" alt="GraphQL Practice Repo" width="30"> GraphQL Practice
Repository created to record my practice learning GraphQL with exercises based on the Udemy Course of Andrew Mead and Apollo GraphQL - Fullstack Tutorial.
Table of contents
Status
- Current repo's version is
- This course has been completed on 26/01/2022 - Certificate
Why it has not any updated dependencies?
After finishing its related Udemy course, I archive this repository and unarchive it when I start a new training and add a link in the Other practice repos
section referring to its new repo. But I don't update any associated dependency due to technology changes during the years between each practice, and the produced code which works with the mentioned requirements
.
Requirements
- Node
v16.13.2
or above - A relational database (like
PostgreSQL
orMySQL
, for example) (for3-prisma
) - pgAdmin or any relational database client (for
3-prisma
)
Repo structure
1-exercises
: Exercises related to Andrew's course.2-apollo
: Server and Client projects from Apollo's Tutorial to understand an end to end implementation.3-prisma
: Prisma learning and integration with a GraphQL server.4-testing
: How to create and run unit tests for a GraphQL server
Setup
After cloning the repo, go to the created folder and install the node packages.
git clone https://github.com/NicolasOmar/graphql-practice.git
cd graphql-practice
npm run setup-all
setup-all
is the command to install all the projects, but if you want to do it one by one, you can change that last line for one of the following:
App Setup | Command |
---|---|
All | npm run setup-all |
Exercises | npm run setup-exercises |
Apollo tutorial | npm run setup-apollo |
Prisma exercises | npm run setup-prisma |
Unit testing | npm run setup-testing |
What did I learn?
- Set and run a server using a minimum configuration
- How to set
typeDefs
andresolvers
- How to set
- Understanding of
Scalar
andCustom Types
- How to make a
Query
- Structure the operator to be called
- Make calls for deep-level objects
- Make calls using operators and configure it through a
resolver
- Understanding, and configuration of
Relational data
throughTypes
- How to make a
Mutation
- Configure
Input Types
to improve readability in Mutation operators
- Configure
- How to make a
Subscription
- Structure a good
folder structure
- Creation of a
Schema file
to hold created Types (Queries, Mutation, Subscriptions, and Custom Types) - Split different Resolvers into files by Operation type or Entity
- Creation of a
- How to make CRUD operations (CREATE, READ, UPDATE & DELETE) to a SQL-based database using
Prisma
- Understand how to map the database config using
prisma db pull
&&prisma generate
- How to use its special annotations in the
schema.prisma
file - How to make changes to the database using
prisma db push
- Integrate the tool in a Node/GraphQL server
- Hash and compare hashed passwords using bcrypt
- Create JWT and verify tokens using jsonwebtoken
- Paginate results by using
take
andskip
properties in queries - Sort the results by using
orderBy
andorder
- Understand how to map the database config using
- How to create and run unit test cases by using Jest
- Run an Apollo GraphQL client for plain Javascript with apollo-boost and cross-fetch
- Create a fake database on the fly using faker
- Build a site with pure HTML with parcel