GraphQL bugfix + query samples

This commit is contained in:
Boris Milašinović
2026-05-12 20:41:06 +02:00
parent 3f2e199ec4
commit 3e0fc96c0e
5 changed files with 491 additions and 3 deletions

View File

@@ -0,0 +1,96 @@
# GraphQL Cheat Sheet
Use endpoint: `/graphql`
## Available queries
- `countries`
- `sports`
- `people`
- `peoplePage(pageNumber, pageSize)`
- `events`
- `eventsForDate(date)`
- `registrations`
## Common arguments
- paging: `first`, `after`, `last`, `before`
- filtering: `where`
- sorting: `order`
## Quick examples
### Get events
```graphql
query {
events(first: 5) {
nodes {
id
name
eventDate
}
}
}
```
### Filter people by country
```graphql
query {
people(where: { countryCode: { eq: "HR" } }, first: 10) {
nodes {
id
firstName
lastName
}
}
}
```
### Sort sports by name
```graphql
query {
sports(order: [{ name: ASC }], first: 10) {
nodes {
id
name
}
}
}
```
### Events for a specific date
```graphql
query {
eventsForDate(date: "2026-06-15", first: 10) {
nodes {
id
name
}
}
}
```
### Classic paging with `peoplePage`
```graphql
query {
peoplePage(pageNumber: 1, pageSize: 5) {
totalCount
items {
id
firstName
lastName
}
}
}
```
## Mutations
- `addEvent(input)`
- `updateEvent(id, input)`
- `deleteEvent(id)`