|
@@ -16,3 +16,76 @@ Requirements
|
|
----
|
|
----
|
|
mongodb on localhost
|
|
mongodb on localhost
|
|
|
|
|
|
|
|
+API
|
|
|
|
+---
|
|
|
|
+```
|
|
|
|
+mutation createUser($login:String!, $password:String!){
|
|
|
|
+ createUser(login:$login, password:$password){
|
|
|
|
+ _id, login
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+query login($login:String!, $password:String!){
|
|
|
|
+ login(login:$login, password:$password)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+mutation pwd($password:String!){
|
|
|
|
+ changePassword(password: $password){
|
|
|
|
+ _id, login
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+mutation createEvent($name:String!, $total:Float!){
|
|
|
|
+ createEvent(name:$name,total:$total){
|
|
|
|
+ _id, name
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+mutation changeEvent($eventId:String!, $name:String!, $total:Float!){
|
|
|
|
+ changeEvent(eventId:$eventId, name:$name, total:$total){
|
|
|
|
+ _id, name, owner
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+query events{
|
|
|
|
+ events{
|
|
|
|
+ _id, name, owner, usersSum, moneyDiff, total
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+mutation createEventMoney($eventId:String!, $amount:Float!){
|
|
|
|
+ createEventMoney(eventId:$eventId, amount:$amount){
|
|
|
|
+ _id, user{
|
|
|
|
+ _id,login
|
|
|
|
+ }, event{
|
|
|
|
+ _id, name}
|
|
|
|
+ , amount
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+query em{
|
|
|
|
+ eventMoneys{
|
|
|
|
+ _id,
|
|
|
|
+ user{
|
|
|
|
+ _id,
|
|
|
|
+ login
|
|
|
|
+ }
|
|
|
|
+ event{
|
|
|
|
+ _id,
|
|
|
|
+ }
|
|
|
|
+ amount
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+query eme($eventId: String!){
|
|
|
|
+ eventMoneysByEvent(eventId:$eventId){
|
|
|
|
+ _id,
|
|
|
|
+ owner,
|
|
|
|
+ event{
|
|
|
|
+ _id,
|
|
|
|
+ }
|
|
|
|
+ amount
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
+
|