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
graphql
1
query GetAllUsers {
2
users {
3
id
4
name
5
username
6
email
7
phone
8
website
9
}
10
}
Response JSON
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
graphql
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
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
}

Schema Users Type

FieldTypeDescription
idID!User ID.
nameString!Full name.
usernameString!Unique handle username.
emailString!Email address.
avatarStringSVG avatar helper image URL.
posts[Post!]List of posts created by user.
todos[Todo!]List of todos assigned to user.