DefaultGraphQLClient

data class DefaultGraphQLClient(val host: String = DefaultGraphQLSettings.DEFAULT_HOST, val port: Int = DefaultGraphQLSettings.DEFAULT_PORT, enableSubscription: Boolean = false) : GraphQLClient

Default GraphQL client implementation backed by Apollo.

Parameters

host

the GraphQL server host.

port

the GraphQL server port.

enableSubscription

whether to enable subscription support (WebSocket transport).

Constructors

Link copied to clipboard
constructor(host: String = DefaultGraphQLSettings.DEFAULT_HOST, port: Int = DefaultGraphQLSettings.DEFAULT_PORT, enableSubscription: Boolean = false)

Properties

Link copied to clipboard
open override val host: String
Link copied to clipboard
open override val port: Int

Functions

Link copied to clipboard
open override fun close()

Closes any resources held by the client.

Link copied to clipboard
open override fun <D : Mutation.Data> mutation(mutation: Mutation<D>): ApolloCall<D>

Prepare a mutation to be executed.

Link copied to clipboard
open override fun <D : Query.Data> query(query: Query<D>): ApolloCall<D>

Prepare a query to be executed.

Link copied to clipboard
open fun serverUrl(): String

Returns the HTTP URL of the GraphQL endpoint.

Link copied to clipboard
open override fun <D : Subscription.Data> subscription(subscription: Subscription<D>): ApolloCall<D>

Prepare a subscription to be executed.

Link copied to clipboard
open override fun subscriptionUrl(): String

Returns the URL to use for GraphQL subscriptions (often a WebSocket URL).