Skip to content

Commit

Permalink
added delete mutations to readme (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
dheidemann committed Jul 19, 2024
1 parent b1de1e3 commit c8b31c8
Showing 1 changed file with 109 additions and 15 deletions.
124 changes: 109 additions & 15 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]")
}
```

### `addEvent`
Adds a new event.
#### Arguments:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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)
}
```

Expand All @@ -343,23 +392,51 @@ 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.

#### Example:
```graphql
mutation {
linkAvailableRoomToEvent(link: {
addAvailableRoomToEvent(link: {
eventID: 1
roomNumber: "101"
buildingID: 1
})
}
```

### `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.
Expand All @@ -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: "[email protected]"
roomNumber: "101"
buildingID: 1
})
}
```

0 comments on commit c8b31c8

Please sign in to comment.