What if you could find everything about a topic in one simple search, no matter where it hides?
Why Search across types in GraphQL? - Purpose & Use Cases
Imagine you have a big library with books, magazines, and newspapers all mixed up. You want to find every item that mentions "climate change". Without a smart system, you'd have to look through each type separately, flipping pages one by one.
Manually searching each type is slow and tiring. You might miss some items or waste time checking the same thing twice. It's easy to get confused and lose track of where you searched.
With "Search across types," you can ask the system once, and it looks through all your different items--books, magazines, newspapers--at the same time. It quickly finds everything that matches your search, saving you time and effort.
query { books(filter: "climate change") { title } magazines(filter: "climate change") { title } newspapers(filter: "climate change") { title } }query { searchAcrossTypes(query: "climate change") { ... on Book { title } ... on Magazine { title } ... on Newspaper { title } } }This lets you find all related information in one go, no matter where it is stored, making your searches faster and more complete.
A journalist researching a story can instantly find all articles, reports, and interviews about a topic across different media types without switching tools.
Manual searching across types is slow and error-prone.
Search across types lets you query many data types at once.
This saves time and ensures you don't miss important information.