Visit the GraphQL UI at http://localhost:8080/q/graphql-ui/. You can access the complete API documentation there.
Below are some examples. You can also see more examples in
Query
query AllRestaurants {
restaurants: allRestaurants {
id
name
endorsements
tables {
size
quantity
}
}
}
Variables
{}
Query
query FindTable(
$time: DateTime!,
$size: Int!,
$endorsements: [Endorsement]!,
) {
restaurants: findTable(
time: $time,
size: $size,
endorsements: $endorsements
) {
id
name
size
endorsements
tables {
size
quantity
}
occupiedTables {
size
quantity
}
availableTables {
size
quantity
}
}
}
Variables
{
"size": 2,
"endorsements": ["gluten"],
"time": "2024-08-01T20:00:00.00Z"
}
Mutation
mutation CreateReservation($request: ReservationRequestInput!) {
reservation: createReservation(reservationRequest: $request) {
... on ReservationInfo {
id
name
size
restrictions
restaurant {
id
name
}
tables {
size
quantity
}
reservationTime
createdTime
updatedTime
active
}
... on ReservationError {
error
message
}
}
}
Variables
{
"request": {
"restaurantId": "B1E6728C-DA7C-4841-BBF3-BA7E97F7E07C",
"name": "Mike Tyson",
"size": 3,
"reservationTime": "2024-08-01T20:00:00.0Z",
"restrictions": [
"paleo"
]
}
}
Mutation
query GetReservation($id: String!) {
reservation: reservation(id: $id) {
id
name
size
restrictions
restaurant {
id
name
}
tables {
size
quantity
}
reservationTime
createdTime
updatedTime
active
}
}
Variables
{
"id": "ae5a8791-43dc-4fee-a6c5-5d6be12344ed"
}
Mutation
query GetReservations($name: String!) {
reservations: reservations(name: $name) {
id
name
size
restrictions
restaurant {
id
name
}
tables {
size
quantity
}
reservationTime
createdTime
updatedTime
active
}
}
Variables
{
"name": "Tobias"
}
Optional parameter: restaurantId: UUID
, return reservations for a single restaurant.
Mutation
mutation DeleteReservation($id: String!) {
reservation: deleteReservation(id: $id) {
... on ReservationInfo {
name
size
reservationTime
}
... on ReservationError {
error
message
}
}
}
Variables
{
"id": "ae5a8791-43dc-4fee-a6c5-5d6be12344ed"
}