io.github.graphglue.data.execution.NodeQueryPartEntry.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.data.execution
import io.github.graphglue.definition.NodeDefinition
import io.github.graphglue.model.Node
/**
* Subclass for [NodeExtensionField] and [NodeSubQuery]
*/
abstract class NodeQueryPartEntry(
val onlyOnTypes: List,
val resultKey: String
) {
/**
* The cost of this entry
*/
abstract val cost: Int
/**
* Checks if this entry affects the given node
*
* @param node the node to check
* @return true if this entry affects the node
*/
fun affectsNode(node: Node): Boolean {
return onlyOnTypes.any { it.nodeType.isInstance(node) }
}
}