liveBook · Manning

Quarkus GraphQL UI

As explained in Quarkus in Action

GraphQL UI is a browser-based interface for composing and executing GraphQL operations against a GraphQL endpoint.

Quarkus GraphQL UI is a browser interface for manually composing and executing operations against a GraphQL endpoint. It is a modified version of GraphiQL. With the Inventory service running in Dev mode, open http://localhost:8083/q/graphql-ui/ to try its car queries and mutations. section 4.5.2

The interface has three working areas:

  • Write an operation in the top-left editor. Press Ctrl+Space for suggestions derived from the GraphQL schema, including available queries and fields. section 4.5.2
  • Enter variable values or HTTP headers in the bottom-left area, then select the blue Play button to execute the operation. section 4.5.2
  • Read the result in the pane on the right. section 4.5.2

Query the fleet

Run `query { cars { id licensePlateNumber model manufacturer } }` to retrieve the registered cars with those four fields. Autocompletion can suggest `cars` and then the fields of its `Car` type; the result appears as JSON under `data.cars`. section 4.5.2

Register and verify a car

Use a `register(car: { ... })` mutation to add a car and request its fields in the response. Later, the same UI can query the Inventory service to check its preloaded cars and verify registrations made through either its GraphQL or gRPC API. A UI result checks the exposed API; a separate MySQL query can confirm database records directly. section 4.5.2 section 7.2.2

Do not confuse GraphQL UI with Quarkus Dev UI. Dev UI is unavailable in production mode, but GraphQL UI can be explicitly included there by setting `quarkus.smallrye-graphql.ui.always-include=true` in `application.properties`. In the shown Inventory configuration, it remains available at http://localhost:8083/q/graphql-ui/. section 11.1.1

How Quarkus in Action covers it

How deep it goes
Walks through the editor, autocompletion, execution, and results, then gives a production inclusion setting; it does not explain UI internals.
Examples
Uses a cars query, a register mutation, and Inventory checks of preloaded and newly persisted cars.
What it assumes
Assumes a running Inventory service and GraphQL endpoint while showing how to use the UI’s controls and schema-based suggestions.
What you can do after
Operate/configure it to execute Inventory GraphQL operations, inspect responses, and make the UI available in production.
How it connects
Connects GraphQL queries, mutations, schemas, and variables to API testing and database persistence checks.

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.