# Search

Search for customers and orders.

```graphql
type Query {
  search(term: String!): [SearchResult!]!
}
```

## Arguments

- `term` (`String!`, required)

## Returns

`[SearchResult!]!`: A result of the `search` query.

## Types

```graphql
"A result of the `search` query."
union SearchResult = Customer | Order
```

## Example

### Search Store

Customers and orders matching a term, `__typename` tells them apart.

```graphql
query SearchStore($term: String!) {
  search(term: $term) {
    __typename
    ... on Customer {
      id
      name
    }
    ... on Order {
      id
      total
      status
    }
  }
}
```

Variables:

```json
{
  "term": "ada"
}
```

Response:

```json
{
  "data": {
    "search": [
      {
        "__typename": "Customer",
        "id": "1",
        "name": "string"
      }
    ]
  }
}
```
