GraphQL Schema Documentation
Users GraphQL API
Query user profile records with nested posts, todos, and address objects via GraphQL.
Get all users
Fetch paginated user list with full profile details.
Query / Mutation
1
query GetAllUsers {
2
users {
3
id
4
name
5
username
6
email
7
phone
8
website
9
}
10
}
Response JSON
1
{
2
"data": {
3
"users": [
4
{
5
"id": "1",
6
"name": "Leanne Graham",
7
"username": "Bret",
8
"email": "Sincere@april.biz",
9
"phone": "1-770-736-8031 x56442",
10
"website": "hildegard.org"
11
}
12
]
13
}
14
}
Get user with posts and todos
Fetch single user profile with nested relational posts and todos lists.
Query / Mutation
1
query GetUserWithNestedLists {
2
user(id: "1") {
3
id
4
name
5
email
6
posts {
7
id
8
title
9
}
10
todos {
11
id
12
title
13
completed
14
}
15
}
16
}
Response JSON
1
{
2
"data": {
3
"user": {
4
"id": "1",
5
"name": "Leanne Graham",
6
"email": "Sincere@april.biz",
7
"posts": [
8
{ "id": "1", "title": "Getting Started with Playground API" }
9
],
10
"todos": [
11
{ "id": "1", "title": "delectus aut autem", "completed": false }
12
]
13
}
14
}
15
}
Pagination & Filtering
Paginate and search user profiles using q, page, and limit arguments.
Paginated Query
1
query SearchUsers {
2
users(q: "Leanne", limit: 5) {
3
id
4
name
5
email
6
}
7
}
Paginated Response
1
{
2
"data": {
3
"users": [
4
{ "id": "1", "name": "Leanne Graham", "email": "Sincere@april.biz" }
5
]
6
}
7
}
Query Arguments
| Argument | Type | Description |
|---|---|---|
| page | Int | Page number. |
| limit | Int | Items per page. |
| q | String | Search query across name, username, and email. |
Schema Users Type
| Field | Type | Description |
|---|---|---|
| id | ID! | User ID. |
| name | String! | Full name. |
| username | String! | Unique handle username. |
| String! | Email address. | |
| avatar | String | SVG avatar helper image URL. |
| posts | [Post!] | List of posts created by user. |
| todos | [Todo!] | List of todos assigned to user. |