Building services with MP GraphQL
In this section, we will learn how to develop a GraphQL application using the MP GraphQL APIs and runtime framework. We'll cover building queries and mutations, and how to invoke them using an interactive web tool called GraphiQL. We'll also cover entities and enumerated types. Finally, we'll cover a technique to reduce unnecessary server-side computations and deliver partial results.
Most GraphQL APIs for Java require you to write a schema first and then build the Java code around it. This approach tends to cause some level of dual maintenance, and it can slow down development as you evolve your application. MP GraphQL uses a code-first approach, meaning that you write the code using patterns similar to Jakarta RESTful Web Services (JAX-RS), and the framework generates the schema at runtime. This makes development and maintenance faster and easier. Let's start by building a basic Hello World
query service.