├── docs ├── graphiql.jpg └── Server.groovy ├── examples ├── dgs-spring-boot │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── neo4j.graphql │ │ │ ├── schema │ │ │ │ └── schema.graphqls │ │ │ └── application.yaml │ │ │ └── kotlin │ │ │ └── org │ │ │ └── neo4j │ │ │ └── graphql │ │ │ └── examples │ │ │ └── dgsspringboot │ │ │ ├── DgsSpringBootApplication.kt │ │ │ ├── datafetcher │ │ │ └── AdditionalDataFetcher.kt │ │ │ └── config │ │ │ ├── GraphQLConfiguration.kt │ │ │ └── Neo4jConfiguration.kt │ └── readme.adoc ├── graphql-spring-boot │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── neo4j.graphql │ │ │ │ ├── graphql │ │ │ │ │ └── schema.graphqls │ │ │ │ └── application.yaml │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── neo4j │ │ │ │ └── graphql │ │ │ │ └── examples │ │ │ │ └── graphqlspringboot │ │ │ │ ├── GraphqlSpringBootApplication.java │ │ │ │ ├── datafetcher │ │ │ │ └── AdditionalDataFetcher.java │ │ │ │ └── config │ │ │ │ ├── GraphQLConfiguration.java │ │ │ │ └── Neo4jConfiguration.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── neo4j │ │ │ └── graphql │ │ │ └── examples │ │ │ └── graphqlspringboot │ │ │ └── datafetcher │ │ │ └── AdditionalDataFetcherTest.java │ ├── readme.adoc │ └── pom.xml ├── graphql-kotlin-spring-boot │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.yaml │ │ │ │ └── schema.graphql │ │ │ └── kotlin │ │ │ │ └── org │ │ │ │ └── neo4j │ │ │ │ └── graphql │ │ │ │ └── examples │ │ │ │ └── graphqlspringboot │ │ │ │ ├── GraphqlSpringBootApplication.kt │ │ │ │ ├── controller │ │ │ │ └── AdditionalQueries.kt │ │ │ │ └── config │ │ │ │ ├── Neo4jConfiguration.kt │ │ │ │ └── GraphQLConfiguration.kt │ │ └── test │ │ │ └── kotlin │ │ │ └── org │ │ │ └── neo4j │ │ │ └── graphql │ │ │ └── examples │ │ │ └── graphqlspringboot │ │ │ └── controller │ │ │ └── QueriesIT.kt │ ├── readme.adoc │ └── pom.xml ├── readme.adoc └── pom.xml ├── core └── src │ ├── test │ ├── kotlin │ │ ├── org │ │ │ └── neo4j │ │ │ │ └── graphql │ │ │ │ ├── asciidoc │ │ │ │ ├── ast │ │ │ │ │ ├── ThematicBreak.kt │ │ │ │ │ ├── StructuralNode.kt │ │ │ │ │ ├── Document.kt │ │ │ │ │ ├── Block.kt │ │ │ │ │ ├── Section.kt │ │ │ │ │ └── CodeBlock.kt │ │ │ │ └── AsciiDocParser.kt │ │ │ │ ├── AugmentationTests.kt │ │ │ │ ├── utils │ │ │ │ └── TestUtils.kt │ │ │ │ ├── TranslatorExceptionTests.kt │ │ │ │ └── CypherTests.kt │ │ ├── demo │ │ │ └── DataFetcherInterceptorDemo.kt │ │ └── com │ │ │ └── intellij │ │ │ └── rt │ │ │ └── execution │ │ │ └── junit │ │ │ └── FileComparisonFailure.java │ └── resources │ │ ├── logback-test.xml │ │ ├── issues │ │ ├── gh-160.adoc │ │ ├── gh-149.adoc │ │ ├── gh-265-querying-multiple-root-fields.adoc │ │ ├── gh-210.adoc │ │ ├── gh-245-cypher-directive-on-relationship.adoc │ │ ├── gh-85.adoc │ │ ├── gh-45.adoc │ │ ├── gh-170.adoc │ │ ├── gh-295-wrong-target-node-alias.adoc │ │ ├── gh-65.adoc │ │ ├── gh-190-cypher-directive-with-passThrough.adoc │ │ ├── gh-163.adoc │ │ ├── gh-47.adoc │ │ ├── gh-27.adoc │ │ ├── gh-112.adoc │ │ ├── gh-169.adoc │ │ ├── gh-267-field-aliasing-does-not-work-if-using-datafetchinginterceptor.adoc │ │ ├── gh-147.adoc │ │ └── gh-299-incorrect-mutation-translation-for-IDs-with-property-aliases.adoc │ │ ├── property-tests.adoc │ │ ├── tck-test-files │ │ ├── cypher │ │ │ ├── directives │ │ │ │ └── ignore.adoc │ │ │ ├── types │ │ │ │ └── datetime.adoc │ │ │ └── where.adoc │ │ └── schema │ │ │ ├── types │ │ │ ├── arrays.adoc │ │ │ └── datetime.adoc │ │ │ ├── simple.adoc │ │ │ ├── directives │ │ │ └── ignore.adoc │ │ │ └── relationship.adoc │ │ ├── translator-tests2.adoc │ │ ├── translator-tests3.adoc │ │ ├── translator-tests-custom-scalars.adoc │ │ └── custom-fields.adoc │ └── main │ ├── kotlin │ └── org │ │ └── neo4j │ │ └── graphql │ │ ├── OptimizedQueryException.kt │ │ ├── InvalidQueryException.kt │ │ ├── Cypher.kt │ │ ├── NoOpCoercing.kt │ │ ├── DataFetchingInterceptor.kt │ │ ├── DirectiveConstants.kt │ │ ├── QueryContext.kt │ │ ├── Translator.kt │ │ ├── SchemaConfig.kt │ │ ├── ExtensionFunctions.kt │ │ ├── handler │ │ ├── CypherDirectiveHandler.kt │ │ ├── BaseDataFetcher.kt │ │ ├── relation │ │ │ ├── DeleteRelationHandler.kt │ │ │ └── CreateRelationHandler.kt │ │ ├── AugmentFieldHandler.kt │ │ ├── CreateTypeHandler.kt │ │ └── DeleteHandler.kt │ │ ├── DynamicProperties.kt │ │ └── RelationshipInfo.kt │ └── resources │ ├── lib_directives.graphql │ └── neo4j_types.graphql ├── .gitignore ├── scripts ├── prepare-release.sh └── release.py ├── release.md ├── .run ├── Reformat Tests.run.xml ├── Update All tests.run.xml └── Run All tests including integration tests.run.xml ├── .github ├── ISSUE_TEMPLATE │ └── bug-report.md └── workflows │ ├── pr-build.yaml │ ├── release-changelog.yaml │ └── changelog-configuration.json ├── .mvn └── wrapper │ └── maven-wrapper.properties └── neo4j-graphql-augmented-schema-generator-maven-plugin ├── src └── main │ └── kotlin │ └── org │ └── neo4j │ └── graphql │ └── augmented_schema_generator │ └── plugin │ └── AugmentedSchemaGeneratorMojo.kt └── pom.xml /docs/graphiql.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-graphql/neo4j-graphql-java/HEAD/docs/graphiql.jpg -------------------------------------------------------------------------------- /examples/dgs-spring-boot/src/main/resources/neo4j.graphql: -------------------------------------------------------------------------------- 1 | type Movie { 2 | title: String 3 | } 4 | -------------------------------------------------------------------------------- /examples/graphql-spring-boot/src/main/resources/neo4j.graphql: -------------------------------------------------------------------------------- 1 | type Movie { 2 | title: String 3 | } 4 | -------------------------------------------------------------------------------- /core/src/test/kotlin/org/neo4j/graphql/asciidoc/ast/ThematicBreak.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.asciidoc.ast 2 | 3 | class ThematicBreak: StructuralNode(null) 4 | -------------------------------------------------------------------------------- /core/src/main/kotlin/org/neo4j/graphql/OptimizedQueryException.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql 2 | 3 | class OptimizedQueryException(message: String) : Exception(message) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | .project 4 | .classpath 5 | .factorypath 6 | .springBeans 7 | .settings 8 | dependency-reduced-pom.xml 9 | *.iml 10 | target 11 | .idea 12 | -------------------------------------------------------------------------------- /core/src/test/kotlin/org/neo4j/graphql/asciidoc/ast/StructuralNode.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.asciidoc.ast 2 | 3 | sealed class StructuralNode( 4 | open val parent: StructuralNode? 5 | ) { 6 | val blocks = mutableListOf() 7 | } 8 | -------------------------------------------------------------------------------- /core/src/main/kotlin/org/neo4j/graphql/InvalidQueryException.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql 2 | 3 | import graphql.GraphQLError 4 | 5 | class InvalidQueryException(@Suppress("MemberVisibilityCanBePrivate") val error: GraphQLError) : 6 | RuntimeException(error.message) 7 | -------------------------------------------------------------------------------- /examples/dgs-spring-boot/src/main/resources/schema/schema.graphqls: -------------------------------------------------------------------------------- 1 | extend type Movie { 2 | bar: String @ignore 3 | javaData: [JavaData!] @ignore 4 | } 5 | 6 | type JavaData { 7 | name: String 8 | } 9 | 10 | extend type Query { 11 | other: String 12 | } 13 | -------------------------------------------------------------------------------- /examples/graphql-spring-boot/src/main/resources/graphql/schema.graphqls: -------------------------------------------------------------------------------- 1 | extend type Movie { 2 | bar: String @ignore 3 | javaData: [JavaData!] @ignore 4 | } 5 | 6 | type JavaData { 7 | name: String 8 | } 9 | 10 | extend type Query { 11 | other: String 12 | } 13 | -------------------------------------------------------------------------------- /core/src/test/kotlin/org/neo4j/graphql/asciidoc/ast/Document.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.asciidoc.ast 2 | 3 | import java.net.URI 4 | 5 | class Document( 6 | uri: URI, 7 | ) : Section(uri.path.substringAfterLast('/'), uri, null) { 8 | 9 | lateinit var content: String 10 | 11 | } 12 | -------------------------------------------------------------------------------- /examples/dgs-spring-boot/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | org: 2 | neo4j: 3 | driver: 4 | uri: bolt://demo.neo4jlabs.com:7687 5 | authentication: 6 | username: movies 7 | password: movies 8 | config: 9 | encrypted: true 10 | database: movies 11 | -------------------------------------------------------------------------------- /core/src/test/kotlin/org/neo4j/graphql/asciidoc/ast/Block.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.asciidoc.ast 2 | 3 | class Block( 4 | parent: StructuralNode, 5 | val content: String 6 | ) : StructuralNode(parent) { 7 | 8 | override fun toString(): String { 9 | return "Block(content='$content')" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/graphql-kotlin-spring-boot/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | org: 2 | neo4j: 3 | driver: 4 | uri: bolt://localhost:7687 5 | authentication: 6 | username: neo4j 7 | password: test 8 | graphql: 9 | packages: 10 | - "org.neo4j.graphql.examples.graphqlspringboot.controller" 11 | 12 | -------------------------------------------------------------------------------- /examples/readme.adoc: -------------------------------------------------------------------------------- 1 | = Examples 2 | 3 | * link:dgs-spring-boot/readme.adoc[Spring Boot integration with Netflix Domain Graph Service (DGS)] (recommended) 4 | * link:graphql-kotlin-spring-boot/readme.adoc[Spring Boot integration with graphql-kotlin] 5 | * link:graphql-spring-boot/readme.adoc[Preview of Spring Boot + Spring GraphQL integration] 6 | -------------------------------------------------------------------------------- /scripts/prepare-release.sh: -------------------------------------------------------------------------------- 1 | 2 | root="$(dirname $(dirname $(realpath "$0")))" 3 | 4 | cd "$root" || exit 5 | 6 | ./mvnw gitflow:release-start 7 | 8 | # update readme.adoc 9 | ./mvnw process-resources -P update-doc 10 | git add --ignore-errors -A -f -- readme.adoc 11 | git commit --amend --no-edit 12 | 13 | ./mvnw gitflow:release-finish 14 | -------------------------------------------------------------------------------- /core/src/test/kotlin/org/neo4j/graphql/asciidoc/ast/Section.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.asciidoc.ast 2 | 3 | import java.net.URI 4 | 5 | open class Section( 6 | val title: String, 7 | val uri: URI, 8 | override val parent: Section?, 9 | ) : StructuralNode(parent) { 10 | 11 | override fun toString(): String { 12 | return "Section(title='$title')" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/kotlin/org/neo4j/graphql/Cypher.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql 2 | 3 | import graphql.schema.GraphQLType 4 | 5 | data class Cypher @JvmOverloads constructor( 6 | val query: String, 7 | val params: Map = emptyMap(), 8 | var type: GraphQLType? = null, 9 | val variable: String 10 | ) { 11 | fun with(p: Map) = this.copy(params = this.params + p) 12 | } 13 | -------------------------------------------------------------------------------- /examples/graphql-spring-boot/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | org: 2 | neo4j: 3 | driver: 4 | uri: bolt://demo.neo4jlabs.com:7687 5 | authentication: 6 | username: movies 7 | password: movies 8 | config: 9 | encrypted: true 10 | database: movies 11 | spring: 12 | graphql: 13 | schema: 14 | printer: 15 | enabled: true 16 | graphiql: 17 | enabled: true 18 | -------------------------------------------------------------------------------- /release.md: -------------------------------------------------------------------------------- 1 | delete local `release` branch (**only** local) 2 | 3 | run: 4 | 5 | mvn gitflow:release-start 6 | 7 | enter the new release number 8 | 9 | adjust the release version in the [readme.adoc](readme.adoc) 10 | 11 | amend commit your changes 12 | 13 | run: 14 | 15 | mvn gitflow:release-finish 16 | 17 | hard reset the `release` branch to the currently created release and start release build from neo4j build server 18 | -------------------------------------------------------------------------------- /examples/dgs-spring-boot/src/main/kotlin/org/neo4j/graphql/examples/dgsspringboot/DgsSpringBootApplication.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.examples.dgsspringboot 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | open class DgsSpringBootApplication 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /examples/graphql-kotlin-spring-boot/src/main/kotlin/org/neo4j/graphql/examples/graphqlspringboot/GraphqlSpringBootApplication.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.examples.graphqlspringboot 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | open class GraphqlSpringBootApplication 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /core/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %-4relative [%thread] %-5level %logger{350} - %msg %n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/graphql-spring-boot/src/main/java/org/neo4j/graphql/examples/graphqlspringboot/GraphqlSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.examples.graphqlspringboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class GraphqlSpringBootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(GraphqlSpringBootApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /examples/graphql-kotlin-spring-boot/src/main/resources/schema.graphql: -------------------------------------------------------------------------------- 1 | type Team { 2 | id: ID! 3 | name: String! 4 | players: [Player!]! @relation(from: "team", to: "player", name: "MEMBER_OF", direction: IN) 5 | memberships: [Membership!]! 6 | } 7 | 8 | type Player { 9 | id: ID! 10 | name: String! 11 | teams: [Team!] @relation(from: "player", to: "team", name: "MEMBER_OF") 12 | memberships: [Membership!]! 13 | } 14 | 15 | type Membership @relation(from: "player", to: "team", name: "MEMBER_OF") { 16 | player: Player! 17 | team: Team! 18 | prop: String 19 | } 20 | -------------------------------------------------------------------------------- /examples/graphql-kotlin-spring-boot/src/main/kotlin/org/neo4j/graphql/examples/graphqlspringboot/controller/AdditionalQueries.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql.examples.graphqlspringboot.controller 2 | 3 | import com.expediagroup.graphql.server.operations.Query 4 | import org.springframework.stereotype.Component 5 | 6 | @Component 7 | class AdditionalQueries : Query { 8 | 9 | fun echo(string: String): String { 10 | return string 11 | } 12 | 13 | fun pojo(param: String): Pojo { 14 | return Pojo(param) 15 | } 16 | 17 | data class Pojo(val id: String) 18 | } 19 | -------------------------------------------------------------------------------- /core/src/main/kotlin/org/neo4j/graphql/NoOpCoercing.kt: -------------------------------------------------------------------------------- 1 | package org.neo4j.graphql 2 | 3 | import graphql.schema.Coercing 4 | import graphql.schema.CoercingParseLiteralException 5 | import graphql.schema.CoercingParseValueException 6 | 7 | object NoOpCoercing : Coercing { 8 | 9 | override fun parseLiteral(input: Any) = input.toJavaValue() 10 | ?: throw CoercingParseLiteralException("literal should not be null") 11 | 12 | override fun serialize(dataFetcherResult: Any) = dataFetcherResult 13 | 14 | override fun parseValue(input: Any) = input.toJavaValue() 15 | ?: throw CoercingParseValueException("literal should not be null") 16 | } 17 | -------------------------------------------------------------------------------- /.run/Reformat Tests.run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |