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

io.github.graphglue.definition.generateNodeDefinition.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.definition

import io.github.graphglue.model.Node
import org.springframework.data.neo4j.core.mapping.Neo4jMappingContext
import org.springframework.data.neo4j.core.mapping.Neo4jPersistentEntity
import kotlin.reflect.KClass

/**
 * Generates a [NodeDefinition] for a specific class
 *
 * @param nodeClass the class to generate the definition for
 * @param mappingContext used to obtain the [Neo4jPersistentEntity]
 * @param extensionFieldDefinitions all known [ExtensionFieldDefinition] beans
 * @return the generated NodeDefinition
 */
fun generateNodeDefinition(
    nodeClass: KClass,
    mappingContext: Neo4jMappingContext,
    extensionFieldDefinitions: Map
): NodeDefinition {
    return NodeDefinition(
        nodeClass, mappingContext.getPersistentEntity(nodeClass.java)!!, extensionFieldDefinitions
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy