Skip to content

Commit

Permalink
Graphql Server setup (#3)
Browse files Browse the repository at this point in the history
* Create README.md

* graphql server setup

* Create README.md

* graphql config

* Update server.js

* Update README.md

* Update .gitignore

* Update queries.md

* Update README.md
  • Loading branch information
Salmandabbakuti authored May 1, 2020
1 parent 140a6d3 commit 483bd39
Show file tree
Hide file tree
Showing 18 changed files with 1,342 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ bin-release/
[Oo]bj/
[Bb]in/

.env
# Other files and folders
.settings/
server/node_modules/
server/rest/node_modules/
server/graphql/node_modules/
# Executables
*.swf
*.air
*.ipa
*.apk
*.env

# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@
#### QLDB'S PartiQL Interface:
>Basic SQL Like Queries are included in ```syntax.md``` file
##### Setup
#### Setup
>update ```.env``` file according to your QLDB Configuration
##### REST Server Setup
```
cd server/rest
npm i
node server.js
```
###### CURL Sample Commands:
>Sample CURL Commands for CRUD are included in ```server/rest/queries.md``` file
##### GraphQL Server Setup
```
cd server
cd server/graphql
npm i
node server.js
```
#### CURL Sample Commands:
>Sample CURL Commands for CRUD are included in ```server/queries.md``` file
###### Queries and Mutation Commands(Experimentation Only):
>Sample queries and mutations are included in ```server/graphql/README.md``` file

###### Special Thanks to :wave: [Lepozepo](https://github.com/Lepozepo) for making simple QLDB module used in this project

Expand Down
File renamed without changes.
75 changes: 75 additions & 0 deletions server/graphql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
### Amazon's QLDB With GraphQL Server Setup

#### Setup
>update ```.env``` file according to your QLDB Configuration
```
npm i
node server.js //go to http://localhost:4000 for GraphQL Playground
```
##### GraphQL Playground
<img align="center" src="https://github.com/Salmandabbakuti/qldb-essentials/blob/master/server/graphql/screen.png" width="90%">

#### Queries and Mutations:
```
#getall
query{
getMovies{
name
producer
rating
rank
}
}
#get movie by field
query{
getMovieByField(filter:{field:"producer",value:"Gale Anne Hurd"}){
name
producer
rating
rank
}
}
#create
mutation{
addMovie(name:"Terminator2", producer:"Gale Ann Hurd",rating:8.1, rank:44){
response
}
}
#update
mutation{
updateMovie(filter:{field:"name",value:"Terminator2"},updatingField:"producer", updatingValue:"Gale Anne Hurd"){
response
}
}
#delete
mutation {
deleteMovie(filter:{field:"name",value:"Terminator2"}){
response
}
}
# Subscriptions
subscription{
notification{
event
data{
response
}
}
}
>history of document can only be queried from AWS QLDB Console itself. it involves with nested objects. so graphql query implementation seems very complex for history.
```
File renamed without changes.
Loading

0 comments on commit 483bd39

Please sign in to comment.