Query

User:

DLive user type has username and displayname which are both unique. username refers to the blockchain username and displayname refers to the displayname used everywhere in DLive. Users could change their displayname once a month but username could never be changed. Treat username as user ID.
There are two entry point queries for User: user(username:) and userByDisplayName(displayname:)

Sample

Sample GraphQL query which returns some basic info:
1
query{
2
userByDisplayName(displayname:"Potato") {
3
username
4
displayname
5
avatar
6
partnerStatus
7
followers {
8
totalCount
9
}
10
}
11
}
Copied!
Your could use a GraphQL client library to send the request or it could be translated to a plain curl request:
1
curl 'https://graphigo.prd.dlive.tv/' --data-binary '{"query":"query{userByDisplayName(displayname: \"Potato\") {username displayname avatar partnerStatus followers{totalCount}}}"}'
Copied!
The response would be in the following format:
1
{
2
"data": {
3
"userByDisplayName": {
4
"username": "dbl-lee",
5
"displayname": "Potato",
6
"avatar": "https://images.prd.dlivecdn.com/avatar/56dfd12a-4998-11e9-97f0-0eb3a818c822",
7
"partnerStatus": "NONE",
8
"followers": {
9
"totalCount": 170
10
}
11
}
12
}
13
}
Copied!

Variable

You may want to reuse the query with different inputs:
1
query sampleQuery($displayname: String!){
2
userByDisplayName(displayname:$displayname) {
3
username
4
displayname
5
avatar
6
partnerStatus
7
followers {
8
totalCount
9
}
10
}
11
}
Copied!
which translates to curl request:
1
curl 'https://graphigo.prd.dlive.tv/' --data-binary '{"operationName":"sampleQuery","variables":{"displayname":"Potato"},"query":"query sampleQuery($displayname: String!) {userByDisplayName(displayname: $displayname) {username displayname avatar partnerStatus followers{totalCount}}}"}'
Copied!

Nested query

If a field is of type User like list field in followers subfield, you could query information of the users in one query:
1
query{
2
userByDisplayName(displayname:"Potato") {
3
username
4
displayname
5
avatar
6
partnerStatus
7
followers(first: 5) {
8
totalCount
9
list {
10
username
11
displayname
12
avatar
13
}
14
}
15
}
16
}
Copied!
which returns data:
1
{
2
"data": {
3
"userByDisplayName": {
4
"username": "dbl-lee",
5
"displayname": "Potato",
6
"avatar": "https://images.prd.dlivecdn.com/avatar/56dfd12a-4998-11e9-97f0-0eb3a818c822",
7
"partnerStatus": "NONE",
8
"followers": {
9
"totalCount": 170,
10
"list": [
11
{
12
"username": "dlive-45601904",
13
"displayname": "SweetCakes",
14
"avatar": "https://images.prd.dlivecdn.com/avatar/6f5bb99c-824a-11e9-a9d7-9a767b854a09"
15
},
16
{
17
"username": "greatkris",
18
"displayname": "greatkris",
19
"avatar": "https://images.prd.dlivecdn.com/avatar/e943de8c-f59f-11e8-aa1d-d22472f442c9"
20
},
21
{
22
"username": "dlive-23624498",
23
"displayname": "CaptainJackedPickle",
24
"avatar": "https://images.prd.dlivecdn.com/avatar/8440ac7a-82f3-11e9-a9d7-9a767b854a09"
25
},
26
{
27
"username": "bama256",
28
"displayname": "BAMA256",
29
"avatar": "https://images.prd.dlivecdn.com/avatar/a02c2bab-84aa-11e9-a9d7-9a767b854a09"
30
},
31
{
32
"username": "cjrodriguez",
33
"displayname": "THEONE2187",
34
"avatar": "https://images.prd.dlivecdn.com/thumbnail/ab9d883e-30aa-11e9-9f23-8ec705f1dd1b"
35
}
36
]
37
}
38
}
39
}
40
}
Copied!
But note that, we do have a limit on complexity of the query and a too complex query would receive an HTTP error with code 422.

Me

To obtain user information from an access token. Use me query with user access token in authorization header. Note that some private info need specific scope and if you don't have required scope an error will be returned.
Sample:
1
query {
2
me {
3
username
4
displayname
5
private {
6
email // which requires email:read scope
7
phone // which requires phone:read scope
8
}
9
}
10
}
Copied!

Livestream

livestream field in user type indicates whether the user is streaming and corresponding livestream info. null means the user is offline.
Copy link
Contents
User: