Example: Integration of Neo4j-GraphQL-Java into a Spring Boot application in combination with Netflix DGS
This example uses the Netflix DGS Framework (Domain Graph Service)
In the Neo4jConfiguration a DataFetchingInterceptor is created, which will be bound to all fields augmented by the neo4j-graphql-library. Its purpose is the execution of the cypher query and the transformation of the query result.
In the GraphQLConfiguration the type definitions of schema are loaded and augmented.
In this example some fields of the enhanced type (neo4j) are extended with custom data fetcher whose schema is separately defined.
With This in place you can
-
configure your neo4j db or use a public one
-
run the spring boot application
-
open http://localhost:8080/graphiql to run some graphql queries e.g. try:
query{
other
movies (options: {limit: 3}){
title
bar
javaData {
name
}
}
}
Take a look into the Test-Case to see, how the generated POJOs of your augmented schema can be used to request data