How do you define a query in GraphQL using Java?
GraphQL queries in Java are defined using the `@QueryMapping` annotation inside a Spring controller.
Thatâ€™s partially correct. In Spring Boot, the `@QueryMapping` annotation is part of the Spring GraphQL integration, but you can also use the `GraphQL` Java library directly for more flexibility.
How would you use the `GraphQL` Java library to define a simple query outside of Spring?