###Technologies used
- graphql yoga for node
- prisma cli
- prisma-bindings nodejs package
- postgres db on heroku free tier
- docker container and pgAdmin (dependencies for prisma-bindings)
- bcrypt library for password hashing + salting
- JWT for auth
Run npm install
inside each folder to install node modules. Each folder is its own standalone project that covers the topics suggested by the folder name
##Folders:
- each folder has its own
/src
folder inside which you can runnpm run start
to fire up the local graphql playground atport 4000
. - Basic concepts of queries etc is n
/basics
- Mutations & Subscriptions code, with modularized files is in
/Mutations&Subscriptions
- prisma & prisma-bindings (node, docker, postgres) in the
graphql-prisma
folder.- there are two services / endpoints for prisma
--
prisma-project-blog
and --prisma-project-books
- there are two services / endpoints for prisma
--
- VScode debug tutorial README is in
/VScode_debug_tute
. Thelaunch.json
config file for VScode debugging is in/.vscode/launch.json
(project root).
query for posts
query {
posts{
id
published
title
author{
name
}
}
}
_subscription for post CRUD and comments CRUD
subscription{
post{
mutation
data{
id
title
body
author{
name
}
published
}
}
}
create posts mutation
mutation{
createPost(postData : {
title: "This is a test post",
body: " This is going to be deleted ... ",
authorID : "33",
published: true
}){
id
published
title
body
author {
name
}
}
}
delete posts mutation
mutation{
deletePost(id:"dace4a09-8fda-4a63-8487-903dfe01862d"){
id
title
body
author{
name
}
}
}
update post mutation
mutation{
updatePost(id:"<< >>", postData: {
title: "LOOKHERE!!!",
body: "This is updated body text! ",
published: true
}) {
id
published
title
body
author{
name
}
}
}
mutation{
deleteComment(id:"comm1"){
text
post{
title
}
author{
name
}
}
mutation{
updateComment(
id: "comm1",
commentData: {text: "here is UPDATED comment text"}){
author{
name
}
text
id
}
}
query{
posts{
id
title
comments{
id
text
author{
name
}
}
author{
name
}
}
}
subscription{
comment(postID: "post1"){
mutation
data{
id
text
author{
name
}
}
}
}