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

com.auritylab.graphql.kotlin.toolkit.spring.configuration.InstrumentationConfiguration.kt Maven / Gradle / Ivy

There is a newer version: 0.7.3
Show newest version
package com.auritylab.graphql.kotlin.toolkit.spring.configuration

import graphql.execution.instrumentation.Instrumentation
import graphql.execution.instrumentation.tracing.TracingInstrumentation
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

/**
 * Takes care about registering [Instrumentation] beans based on the properties ([Properties]).
 */
@Configuration
class InstrumentationConfiguration {
    /**
     * Will conditionally create a bean of type [TracingInstrumentation] if the
     * "graphql-kotlin-toolkit.spring.enableTracing" property is set to "true".
     */
    @Bean
    @ConditionalOnProperty(
        prefix = "graphql-kotlin-toolkit.spring.instrumentation",
        name = ["enable-tracing-instrumentation"],
        havingValue = "true"
    )
    fun tracingInstrumentation(): Instrumentation = TracingInstrumentation()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy