Complete the code to define a union type named SearchResult.
union SearchResult = [1] | Book | AuthorThe union type SearchResult includes Movie, Book, and Author types.
Complete the query to search for a SearchResult by ID.
query { search(id: 1) { ... on [1] { title } ... on Author { name } } }The query uses an inline fragment on Book to get the title field.
Fix the error in the union type definition by completing the code.
union SearchResult = Book | [1] | AuthorUnion types can only include object types, not scalar types like String or Int.
Fill both blanks to complete the query using inline fragments for SearchResult.
query { search(id: 2) { ... on [1] { title } ... on [2] { name } } }The query uses inline fragments on Book and Author to get their respective fields.
Fill all three blanks to define a union and query it correctly.
union SearchResult = [1] | [2] | Author query { search(id: 3) { ... on [3] { title } ... on Author { name } } }
The union includes Director, Movie, and Author. The query uses an inline fragment on Movie to get the title.
