Understanding GraphQL
In Chapter 8, Building and Securing Web Services Using Minimal APIs, you learned how to define a Web API service by mapping request path endpoints to lambda expressions or methods that return the response. Any parameters and the format of responses are under the control of the service. A client cannot ask for what they exactly need or use more efficient data formats.
If you completed the online-only section, Exposing Data via the Web Using OData, then you know that OData has a built-in query language for the client to control what data they want to be returned. However, OData has a rather old-fashioned approach and is tied to the HTTP standard, for example, using query strings in an HTTP request.
If you would prefer to use a more modern and flexible technology to combine and expose your data as a service, then a good alternative is GraphQL.
Like OData, GraphQL is a standard for describing your data and then querying it that gives the client control...