# Query Fields

Documentation for query fields supported by the Font Awesome GraphQL API.

> These are the top-level query fields in the schema.

## me ([Account](/apis/graphql/objects.md#account))

_The account identified by the access token used in the `Authorization` header._

## release ([Release](/apis/graphql/objects.md#release))

_Metadata for the release specified by the `version` argument._

| Argument  | <div style="width:70px;">Type</div> | Description                                                                                                                                                                             |
| --------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | `String!`                           | _required_. Must be a major.minor.patch version number like "7.0.0" or major."x" like "7.x". The word "latest" will resolve to the latest full version of 5.x but is deprecated for v6. |

## releases ([[Release](/apis/graphql/objects.md#release)])

_List of all available releases._

## searchPaginated ([IconsPaginated](/apis/graphql/objects.md#iconspaginated))

_Returns a page of icons matching the query, with pagination metadata._

If this field resolves as `null`, it means there was a problem executing the search, such as attempting to search on a non-existent version of Font Awesome. The `errors` returned may include additional information.

| Argument   | <div style="width:70px;">Type</div> | Description                                                                                                                                                                          |
| ---------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `version`  | `String!`                           | _required_. Must be a major.minor.patch version number like "7.0.1" or major."x" like "7.x". (The word "latest" is deprecated and will always resolve to the same version as "5.x".) |
| `query`    | `String!`                           | _required_. A string of search terms, like "coff" or "coffee mug". Max length: 512.                                                                                                  |
| `page`     | `Int`                               | default: 1. The page of results to return. Pages start at 1.                                                                                                                         |
| `pageSize` | `Int`                               | default: 20. max: 50. Number of icons per page.                                                                                                                                      |

#### Example:

This returns the first three results matching the query "coff" for v7.2.0, along with pagination metadata.

```graphql
searchPaginated(version: "7.2.0", query: "coff", page: 1, pageSize: 3) {
  page
  pageSize
  totalIconCount
  totalPageCount
  icons {
    id
    label
    unicode
  }
}
```

```json
{
  "data": {
    "searchPaginated": {
      "page": 1,
      "pageSize": 3,
      "totalIconCount": 276,
      "totalPageCount": 92,
      "icons": [
        { "id": "coffin-cross", "label": "Coffin Cross", "unicode": "e051" },
        { "id": "coffin", "label": "Coffin", "unicode": "f6c6" },
        { "id": "coffee-pot", "label": "Coffee Pot", "unicode": "e002" }
      ]
    }
  }
}
```

#### Fuzzy Search vs. Finding an Icon by Name

The `searchPaginated` field is intended for fuzzy searching. It does a lot more than
just match search terms against the names of icons.
That's great for helping users to discover icons according to concepts or word associations.
It also helps if you can't remember the exact name of an icon: close enough is
probably good enough!

When searching "coffee", for example, it may help
you discover that there are coffee-related icons beyond that familiar `mug-saucer`
icon--which, by the way, is no longer called "coffee"! A search for "coffee"
also finds coffee beans, coffee pots, to-go coffee cups, and more.

However, if you want to look up a specific icon by name, there's no guarantee
that it'll turn up as the first search result, even if you search by its exact
name. So if you're looking to [select a specific icon by name](/apis/graphql/objects.md#selecting-icons-by-name),
use the `icon` field under a [`release`](/apis/graphql/objects.md#release) instead of `search`.

## getKitDownload ([KitDownload!](/apis/graphql/objects.md#kitdownload))

_Poll for the status of kit download request._

After a kit download request is started with the [`createKitDownload`](/apis/graphql/mutation-fields.md#createkitdownload-kitdownload) mutation, use this query field with the returned `buildId` to poll for the status of the kit download request until it is `READY` and the short-lived `url` for downloading the kit zip archive is available.

While the kit download request is still being processed, the returned [`KitDownload`](/apis/graphql/objects.md#kitdownload) object will have a status of `PENDING`. The client should continue polling with this query field until the status changes to `READY`.

The client should poll no more than once per second to avoid being rate-limited.

| <div style="width: 90px">Argument</div> | <div style="width:90px;">Type</div>             | Description                                                                                                                                                                                                                 |
| --------------------------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `buildId`                               | `String!`                                       | _required_. A `buildId` from a [`KitDownload`](/apis/graphql/objects.md#kitdownload) object produced by a prior invocation of the [`createKitDownload`](/apis/graphql/mutation-fields.md#createkitdownload-kitdownload) mutation. |
| `kitToken`                              | `String!`                                       | _required_. The kit token for the kit download request being polled.                                                                                                                                                        |
| `buildType`                             | [`BuildType!`](/apis/graphql/objects.md#buildtype) | _required_. The type of kit download request being polled.                                                                                                                                                                  |

## Deprecated

#### search ([[Icon](/apis/graphql/objects.md#icon)])

**Deprecated.** Use [`searchPaginated`](#searchpaginated-iconspaginated) instead.

_Results for an icon query, using the same search engine that powers the [Icon Gallery](https://fontawesome.com/icons)._

If this field resolves as `null`, it means there was a problem executing the search,
such as attempting to search on a non-existent version of Font Awesome. The `errors` returned may include additional information.

| Argument  | <div style="width:70px;">Type</div> | Description                                                                                                                                                                                           |
| --------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version` | `String!`                           | _required_. Must be a major.minor.patch version number like "7.0.1" or major."x" like "7.x". The word "latest" will resolve to the latest full version of 7.x but is **deprecated for v6 and above**. |
| `query`   | `String!`                           | _required_. A string of search terms, like "coff" or "coffee mug"                                                                                                                                     |
| `first`   | `Integer`                           | default: 15. Limit results to this number: the first "X" results.                                                                                                                                     |

#### Example:

This will return the first five results matching the query "coff" for v7.0.0.

```js
search(version: "7.0.0", query: "coff", first: 5) { id }
```

```js
{
  "data": {
    "search": [
      {
        "id": "coffin-cross"
      },
      {
        "id": "coffin"
      },
      {
        "id": "coffee-togo"
      },
      {
        "id": "coffee-pot"
      },
      {
        "id": "coffee"
      }
    ]
  }
}
```
