This example uses the Springs new GraphQL library
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
}
}
}