From c8b31c85b611f9fc23bfb3fe3d118146c9f76061 Mon Sep 17 00:00:00 2001 From: Daniel Heidemann Date: Fri, 19 Jul 2024 09:44:15 +0200 Subject: [PATCH] added delete mutations to readme (#41) --- server/README.md | 124 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 109 insertions(+), 15 deletions(-) diff --git a/server/README.md b/server/README.md index 38f0847..7c771b2 100644 --- a/server/README.md +++ b/server/README.md @@ -230,6 +230,18 @@ mutation { } ``` +### `deleteUser` +Deletes a list of users. *Note: Tutors and Students are users.* +#### Arguments: +- `mail: [String!]!` - Email of the users. + +#### Example: +```graphql +mutation { + deleteUser(mail: "jane.doe@example.com") +} +``` + ### `addEvent` Adds a new event. #### Arguments: @@ -271,6 +283,18 @@ mutation { } ``` +### `deleteEvent` +Deletes a list of events. +#### Arguments: +- `eventID: [Int!]!` - IDs of the event + +#### Example: +```graphql +mutation { + deleteEvent(eventID: [1, 2]) +} +``` + ### `addBuilding` Adds a new building. #### Arguments: @@ -290,6 +314,38 @@ mutation { } ``` +### ~~`updateBuilding`~~ +Updates a building's details. +#### Arguments: +- `buildingID: Int!` - ID of the building. +- `building: NewBuilding!` - Updated details of the building. + +#### Example: +```graphql +mutation { + updateBuilding(buildingID: 1, building: { + name: "Science Building" + street: "123 Main St" + number: "1" + city: "Example City" + zip: 12345 + osm: "updated-osm-link" + }) +} +``` + +### `deleteBuilding` +Deletes a list of buildings. *Note: This also deletes all rooms in the buildings* +#### Arguments: +- `buildingID: [Int!]!` - IDs of buildings + +#### Example: +```graphql +mutation { + deleteBuilding(buildingID: [1, 2]) +} +``` + ### `addRoom` Adds a new room. #### Arguments: @@ -308,23 +364,16 @@ mutation { } ``` -### ~~`updateBuilding`~~ -Updates a building's details. +### `deleteRoom` +Deletes a room in a building. #### Arguments: -- `buildingID: Int!` - ID of the building. -- `building: NewBuilding!` - Updated details of the building. +- `roomNumber: String!` - Number of room +- `buildingID: [Int!]!` - IDs of buildings #### Example: ```graphql mutation { - updateBuilding(buildingID: 1, building: { - name: "Science Building" - street: "123 Main St" - number: "1" - city: "Example City" - zip: 12345 - osm: "updated-osm-link" - }) + deleteRoom(roomNumber: "101", buildingID: 1) } ``` @@ -343,7 +392,19 @@ mutation { } ``` -### `linkAvailableRoomToEvent` +### `deleteTopic` +Deletes a list of topics. *Note: This also deletes all events related to it* +#### Arguments: +- `name: [String!]!` - Names of topics + +#### Example: +```graphql +mutation { + deleteTopic(name: "Math") +} +``` + +### `addAvailableRoomToEvent` Links an available room to an event. #### Arguments: - `link: NewRoomToEventLink!` - Details of the room-event link. @@ -351,7 +412,7 @@ Links an available room to an event. #### Example: ```graphql mutation { - linkAvailableRoomToEvent(link: { + addAvailableRoomToEvent(link: { eventID: 1 roomNumber: "101" buildingID: 1 @@ -359,7 +420,23 @@ mutation { } ``` -### `linkTutorToEventAndRoom` +### `deleteRoomFromEvent` +Unmarks a room as available for an event. +#### Arguments: +- `link: NewRoomToEventLink!` - Details of the room-event link. + +#### Example: +```graphql +mutation { + deleteRoomFromEvent(link: { + eventID: 1 + roomNumber: "101" + buildingID: 1 + }) +} +``` + +### `assignTutorToEvent` Links a tutor to an event and room. #### Arguments: - `link: NewEventToTutorLink!` - Details of the tutor-event-room link. @@ -375,3 +452,20 @@ mutation { }) } ``` + +### `unassignTutorFromEvent` +Unassign a tutor from an event and room. +#### Arguments: +- `link: NewEventToTutorLink!` - Details of the tutor-event-room link. + +#### Example: +```graphql +mutation { + unassignTutorFromEvent(link: { + eventID: 1 + tutorMail: "tutor1@example.com" + roomNumber: "101" + buildingID: 1 + }) +} +```