graphql.nadel.instrumentation.parameters.NadelInstrumentationQueryValidationParameters.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nadel Show documentation
Show all versions of nadel Show documentation
Nadel is a Java library that combines multiple GrahpQL services together into one API.
package graphql.nadel.instrumentation.parameters
import graphql.ExecutionInput
import graphql.execution.instrumentation.InstrumentationState
import graphql.language.Document
import graphql.schema.GraphQLSchema
/**
* Parameters sent to [graphql.nadel.instrumentation.NadelInstrumentation] methods
*/
data class NadelInstrumentationQueryValidationParameters(
val executionInput: ExecutionInput,
val document: Document,
val schema: GraphQLSchema,
private val instrumentationState: InstrumentationState?,
private val context: Any?,
){
fun getContext(): T? {
@Suppress("UNCHECKED_CAST") // trust the caller
return context as T?
}
fun getInstrumentationState(): T? {
@Suppress("UNCHECKED_CAST") // trust the caller
return instrumentationState as T?
}
}