-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
140a6d3
commit 483bd39
Showing
18 changed files
with
1,342 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.