Package-level declarations

Types

Link copied to clipboard
@Path(value = "/graphql")
@Produces(value = ["application/json"])
open class GraphQLResource @Inject constructor(val graphQL: GraphQL, val graphQLConfig: GraphQLConfig, @Nullable val dataLoaderRegistryFactory: KotlinDataLoaderRegistryFactory? = null, appConfig: TribeApplicationConfig, val creator: WebSocketCreator)

Jersey Resource entry point to GraphQL execution. Configures the graphql schemas at injection time and then executes a GraphQLRequest specified query when requested.

Link copied to clipboard
@Path(value = "/graphql/stream")
@Produces(value = ["application/json"])
open class GraphQLSseResource @Inject constructor(val graphQL: GraphQL, val graphQLConfig: GraphQLConfig, val objectMapper: ObjectMapper, @Nullable val dataLoaderRegistryFactory: KotlinDataLoaderRegistryFactory? = null)

Implements the graphql-sse protocol from https://github.com/enisdenjo/graphql-sse/blob/master/PROTOCOL.md Both "Single connection mode" and "Distinct connections mode" are supported at the /app/graphql/stream endpoint. "Distinct connections mode" will set a ContainerRequestContext on the GraphQLContext, however "Single connection mode" will not, as there are multiple requests involved in the execution of a query.

Link copied to clipboard
internal data class StreamInfo(val scope: CoroutineScope, val principal: Principal?, val eventSink: SseEventSink, val sse: Sse)

Connection level metadata for active streams to facilitate asynchronous processing

Properties

Link copied to clipboard
private val log: KLogger
private val log: KLogger
Link copied to clipboard
private const val STREAM_TOKEN_HEADER: String
Link copied to clipboard
private const val STREAM_TOKEN_QUERY_PARAM: String

Functions

Link copied to clipboard
inline fun <T> contextMap(value: T?): Map<*, Any>

Helper method for null-safe context map construction

Link copied to clipboard
fun getGraphQLContextMap(scope: CoroutineScope, principal: Principal? = null): Map<*, Any>

Helper method to construct a GraphQLContext's underlying Map from a CoroutineScope and optional Principal.

Link copied to clipboard
internal fun unauthorizedResponse(): Response

Returns a response telling the browser that basic authorization is required