io.github.graphglue.graphql.schema.DelegateDataFetchingEnvironment.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphglue-core Show documentation
Show all versions of graphglue-core Show documentation
A library to develop annotation-based code-first GraphQL servers using GraphQL Kotlin, Spring Boot and Neo4j - excluding Spring GraphQL server dependencies
The newest version!
package io.github.graphglue.graphql.schema
import graphql.schema.DataFetchingEnvironment
import io.github.graphglue.model.property.BasePropertyDelegate
/**
* [DataFetchingEnvironment] which delegates all functionality to [parent], except for [getSource], which returns
* [source] instead
*
* @param parent the delegate which handles most [DataFetchingEnvironment] functionality
* @param source the override for [getSource]
*/
class DelegateDataFetchingEnvironment(
private val parent: DataFetchingEnvironment, private val source: BasePropertyDelegate<*, *>
) : DataFetchingEnvironment by parent {
@Suppress("UNCHECKED_CAST")
override fun getSource() = source as T
}