Spring Boot GraphQL API
In this story, we’ll implement a sample CRUD GraphQL API that uses Spring Boot, and Spring Data JPA with PostgreSQL.
Prerequisites
This is the list of all the prerequisites for following this story:
- Spring Boot 2.6.5
- Maven 3.6.3
- Java 17
- PostgreSQL
Overview
What is GraphQL?
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools. — https://graphql.org/
GraphQL was developed internally by Facebook in 2012 before being publicly released in 2015. On 7 November 2018, the GraphQL project was moved from Facebook to the newly established GraphQL Foundation, hosted by the non-profit Linux Foundation. Today, GraphQL is used by teams of all sizes in many different environments such as Facebook, Github, IBM, Airbnb, Shopify, etc.