Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.51 KB

File metadata and controls

36 lines (27 loc) · 1.51 KB

Example: Integration of Neo4j-GraphQL-Java into a Spring Boot application using Springs GraphQL

Overview

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

Run the example

  1. configure your neo4j db or use a public one

  2. run the spring boot application

  3. open http://localhost:8080/graphiql to run some graphql queries e.g. try:

query{
  other
  movies (options: {limit: 3}){
    title
    bar
    javaData {
      name
    }
  }
}