Getting started
About
GraphGlue is a library to develop annotation-based code-first GraphQL servers using GraphQL Kotlin, Spring Boot and Neo4j.
Installation
Full Installation
- Gradle Kotlin
- Maven
implementation("io.github.graphglue", "graphglue", "7.1.0")
<dependency>
<groupId>io.github.graphglue</groupId>
<artifactId>graphglue</artifactId>
<version>7.1.0</version>
</dependency>
Core Installation
This is meant to be used when the project consits of multiple modules, and the module containing the domain model should not provide the beans for the GraphQL server.
this has no dependency on com.expediagroup:graphql-kotlin-spring-server
, however it still depends on com.expediagroup:graphql-kotlin-server
.
- Gradle Kotlin
- Maven
implementation("io.github.graphglue", "graphglue-core", "7.1.0")
<dependency>
<groupId>io.github.graphglue</groupId>
<artifactId>graphglue-core</artifactId>
<version>7.1.0</version>
</dependency>
If you want to use Spring Data Repositories, please make sure to annotate your Application
class with @EnableGraphGlueRepositories
Database setup
GraphGlue needs a Neo4j database to work.
Only the latest 5.x version is officially supported, however older 5.x versions might work as well.
Due to how we check permissions, we recommend using the Graphglue Neo4j authorization plugin.
Additionally, due to a memory reporting bug in Neo4j when using UNWIND
in combination with ORDER BY
and LIMIT
, we recommend setting dbms.memory.transaction.total.max
to 0
, disabling the limit.
A docker image based on the community edition of the official Neo4j image is available at ghcr.io/graphglue/neo4j:main
.
Features
- Declare relations in Kotlin
- Many side of relations are automatically transformed to connections in GraphQL
- Lazy loading support in Kotlin for easy algorithm implementation, included single-query fetching of sub-properties
- GraphQL queries directly translated into Neo4j Cypher
- One GraphQL query maps to one Cypher query (in case lazy loading and manual authorization checking are not used)
- Declarative & extensible authorization aproach
- Specify Node-based authorization using annotations
- Implement custom logic using Spring beans
- "Inherit" permissions from other nodes via relations
- Automatic permission checking when using relations
- Automatic
node
GraphQL query and connection-like queries if specified - Ordering & Filtering
- Filter by properties, and even across relations
- Add custom, property-independent filter using annotations and Spring beans
- Order by properties
- Always performed directly in the database
- Use your favorite GraphQL Kotlin and Spring Data Neo4j features
- Integrated GraphiQL GraphQL IDE with explorer plugin
Building locally
Build the project:
./gradlew clean build
Deploy to the local maven repository
./gradlew publishToMavenLocal