title: graphql-java SPQR: how to use @GraphQLUnion annotation?
body: <p>I inherited a project using GraphQL in Java with Grapqhl-SPQR spring boot starter package (v 0.0.3). It uses annotations to autogenerate the GraphQL SDL, but I need to improve error handling. From what I have found online, I need to implement a union of different types so the user can query multiple types at the same time. Almost all of the online guides discuss this implementation in SDL. I am trying to figure out how to do this with GraphQL SPQR.</p>
  <p>So if I have a type</p>
  <pre><code>type User {
    id: ID!
    name: String
  }
  </code></pre>
  <p>and another type</p>
  <pre><code>type UserError {
    message: String
  }
  </code></pre>
  <p>Then I can create a union using <code>union UserResult = User | UserError</code> in SDL so that I can query.</p>
  <pre><code>userResult(id: 1) {
    ... on User {
      id
      name
    }
    ... on UserError {
      message
  }
  
  </code></pre>
  <p>How do I create a union in Graphql-SPQR? I know that there is an <code>@GraphQLUnion</code> annotation, but I can't find any working examples of its implementation. Does anyone have examples or can point me to examples?</p>