4 The Neo4j GraphQL Library

 

This chapter covers

  • Reviewing common issues that arise when building GraphQL API applications
  • Introducing database integrations for GraphQL that aim to address these common problems, including the Neo4j GraphQL library
  • Building a GraphQL endpoint backed by Neo4j, taking advantage of the features of the Neo4j GraphQL library, such as generated query and mutation types, filtering, and temporal and spatial data types
  • Extending the functionality of our autogenerated GraphQL API with custom logic
  • Introspecting a GraphQL schema from an existing Neo4j database

GraphQL backend implementations commonly run into a set of issues that negatively impact performance and developer productivity. We’ve identified some of these problems previously (e.g., the n + 1 query problem), and in this chapter, we take a deeper look at these common issues and discuss how they can be mitigated, using database integrations for GraphQL that make it easier to build efficient GraphQL APIs backed by databases.

4.1 Common GraphQL problems

4.1.1 Poor performance and the n + 1 query problem

4.1.2 Boilerplate and developer productivity

4.2 Introducing GraphQL database integrations

4.3 The Neo4j GraphQL Library

4.3.1 Project setup

4.3.2 Generated GraphQL schema from type definitions

4.4 Basic GraphQL queries

4.5 Ordering and pagination

4.6 Nested queries

4.7 Filtering

4.7.1 where argument

4.7.2 Nested filter

4.7.3 Logical operators: AND, OR

4.7.4 Filtering in selections

4.8 Working with temporal fields

sitemap