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

io.github.graphglue.graphql.schema.DelegateDataFetchingEnvironment.kt Maven / Gradle / Ivy

Go to download

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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy