/
CommandFetchMods.java
49 lines (42 loc) · 1.47 KB
/
CommandFetchMods.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.github.twitch4j.graphql.command;
import com.apollographql.apollo.ApolloCall;
import com.apollographql.apollo.ApolloClient;
import com.github.twitch4j.graphql.internal.FetchModsQuery;
public class CommandFetchMods extends BaseCommand<FetchModsQuery.Data> {
/**
* The login name of the channel whose mod list is being queried
*/
private final String channelLogin;
/**
* Relay cursor for forward pagination (optional)
*/
private final String cursor;
/**
* The maximum number of nodes to return in a single call
*/
private final int limit;
/**
* Constructor
*
* @param apolloClient Apollo Client
* @param channelLogin The login name of the channel whose mod list is being queried
* @param cursor Relay cursor for forward pagination (optional)
* @param limit The maximum number of nodes to return in a single call
*/
public CommandFetchMods(ApolloClient apolloClient, String channelLogin, String cursor, Integer limit) {
super(apolloClient);
this.channelLogin = channelLogin;
this.cursor = cursor;
this.limit = limit != null ? limit : 100;
}
@Override
protected ApolloCall<FetchModsQuery.Data> getGraphQLCall() {
return apolloClient.query(
FetchModsQuery.builder()
.channelLogin(channelLogin)
.after(cursor)
.first(limit)
.build()
);
}
}