All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.twitch4j.graphql.command.CommandFetchPoll Maven / Gradle / Ivy

The newest version!
package com.github.twitch4j.graphql.command;

import com.apollographql.apollo.ApolloCall;
import com.apollographql.apollo.ApolloClient;
import com.github.twitch4j.graphql.internal.FetchPollQuery;
import lombok.NonNull;

public class CommandFetchPoll extends BaseCommand {
    private final String pollId;

    /**
     * Constructor
     *
     * @param apolloClient Apollo Client
     * @param pollId       Poll Id
     */
    public CommandFetchPoll(@NonNull ApolloClient apolloClient, @NonNull String pollId) {
        super(apolloClient);
        this.pollId = pollId;
    }

    @Override
    protected ApolloCall getGraphQLCall() {
        return apolloClient.query(
            FetchPollQuery.builder()
                .id(pollId)
                .build()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy