Skip to content

Commit

Permalink
added subject field; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dheidemann committed Jun 26, 2024
1 parent a4962b1 commit af628bd
Show file tree
Hide file tree
Showing 11 changed files with 360 additions and 72 deletions.
38 changes: 23 additions & 15 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ query {

### `events`
Fetch a list of all events.
Possible values for the `subjects` input are `MATHEMATICS`, 'PHYSICS', 'INFORMATICS' and 'GENERAL'. Querying without the `subjects` argument simply returns all events.

#### Arguments (optional):
- `subjects` ([Subject]): List of subjects to filter events.

#### Example
```graphql
query {
events {
events(subjects: [INFORMATICS, MATHEMATICS]) { # optional
id
tutor {
fn
Expand All @@ -53,6 +57,7 @@ query {
}
title
description
subject
building {
id
name
Expand Down Expand Up @@ -104,7 +109,7 @@ mutation {
fn: "John"
sn: "Doe"
mail: "[email protected]"
answers: ["Answer1", "Answer2"]
answers: ["Answer1", "Answer2"] # optional
})
}
```
Expand All @@ -119,7 +124,7 @@ Update the acceptance status of a student.
#### Example
```graphql
mutation {
updateStudentAcceptedStatus(studentId: "1", accepted: true)
updateStudentAcceptedStatus(studentMail: "[email protected]", accepted: true)
}
```

Expand All @@ -145,12 +150,12 @@ Update an existing tutor's details.

#### Arguments
- `tutorMail` (String!): The email of the tutor to be updated.
- `input` (NewTutor!): The new details of the tutor.
- `tutor` (NewTutor!): The new details of the tutor.

#### Example
```graphql
mutation {
updateTutor(tutorMail: "[email protected]", input: {
updateTutor(tutorMail: "[email protected]", tutor: {
fn: "Jane"
sn: "Smith"
mail: "[email protected]"
Expand All @@ -160,6 +165,7 @@ mutation {

### `addEvent`
Add a new event.
Possible values for the `subject` field are `MATHEMATICS`, 'PHYSICS', 'INFORMATICS' and 'GENERAL'

#### Arguments
- `event` (NewEvent!): The details of the new event.
Expand All @@ -168,11 +174,12 @@ Add a new event.
```graphql
mutation {
addEvent(event: {
tutorMail: "[email protected]"
tutorMail: "[email protected]" # optional
title: "New Event"
description: "An exciting new event"
buildingId: "1"
room: "101"
description: "An exciting new event" # optional
subject: INFORMATICS
buildingId: "1" # optional
room: "101" # optional
from: "2024-07-01T10:00:00Z"
to: "2024-07-01T12:00:00Z"
})
Expand All @@ -190,11 +197,12 @@ Update an existing event's details.
```graphql
mutation {
updateEvent(eventId: "1", event: {
tutorMail: "[email protected]"
tutorMail: "[email protected]" # optional
title: "Updated Event"
description: "An updated exciting event"
buildingId: "1"
room: "101"
description: "An updated exciting event" # optional
subject: PHYSICS
buildingId: "1" # optional
room: "101" # optional
from: "2024-07-01T10:00:00Z"
to: "2024-07-01T12:00:00Z"
})
Expand All @@ -217,7 +225,7 @@ mutation {
city: "Metropolis"
zip: 12345
osmLink: "https://osm.org/link"
rooms: ["101", "102"]
rooms: ["101", "102"] # optional
})
}
```
Expand Down Expand Up @@ -253,7 +261,7 @@ mutation {
city: "Metropolis"
zip: 12345
osmLink: "https://osm.org/newlink"
rooms: ["101", "102", "103"]
rooms: ["101", "102", "103"] # optional
})
}
```
Loading

0 comments on commit af628bd

Please sign in to comment.