# Query on a Profile's data
URL: https://www.quiltt.dev/api/graphql/queries
Description: Discover how to fetch data using GraphQL queries.
Navigation: api → graphql → queries
Tags: API, GraphQL

Queries are the primary way of fetching data associated with a Profile, such as Connections, Accounts, Transactions and more.

Info:
A powerful feature of queries is that they natively support requesting complex, nested data structures. This allows you to:

1. Reduce the number of network requests required to get the data you need.
2. Improve the type-safety of your application, letting GraphQL's strongly-typed schema do the heavy lifting.
3. Pass predictable, structured query responses to component trees in frameworks like React.

## Available Queries

Currently the following Queries are generally available via GraphQL:

- `profile`: Access information about the authenticated Profile.
- `connection`: Look up a Connection by its ID.
- `connections`: Get a list of Connections with filters, search and sort options.
- `account`: Look up an Account by its ID.
- `accounts`: Get a list of Accounts with filters, search and sort options.
- `transaction`: Look up a Transaction by its ID.
- `transactions`: Get a paginated list of Transactions, with filters, search and sort options.
- `holding`: Look up a Holding by its ID.
- `holdings`: Get a paginated list of Holdings.
- `statement`: Look up a Statement by its ID.
- `statements`: Get a paginated list of Account Statements, with filters, search and sort options.

## Examples

### `profile` Query

In this example, we will define a `profile` query to get the user's basic profile details:

#### Request

Code Examples:

  ```graphql
    query GetProfile {
      profile [id
        email
        phone
        metadata]
    }
    ```
  ```sh
    curl --request POST \
      --url 'https://api.quiltt.io/v1/graphql' \
      --header 'Authorization: Bearer <SESSION_TOKEN>' \
      --header 'Content-Type: application/json' \
      --data @- <<GRAPHQL
      {
        "query": "query GetProfile {
          profile [id
            email
            phone
            metadata]
        }"
      }
GRAPHQL
    ```
  ```json
{
  "data": {
    "profile": {
      "id": "p_11oaRngjEOLf1YcBdZqKp0E",
      "email": "example@quiltt.io",
      "phone": null,
      "metadata": ["favoriteColor": "Purple",]
    }
  }
}
```

In GraphQL, successful queries always return a `data` object that mirrors the structure of your request.

## Using Queries with React

The [Quiltt React SDK](https://github.com/quiltt/quiltt-sdks/tree/main/packages/react#readme) provides a built-in hook to call the Quiltt GraphQL API. Additionally, the GraphQL community provides a rich ecosystem of open-source clients and libraries that seamlessly plug-in to your client-side or server-side framework of choice.

For example, here's the `profile` query example implemented using our `useQuery` hook.

```jsx

// Set up your query string to fetch the user's profile.
const GET_PROFILE = gql`
  query {
    profile [id
      email
      name
      phone]
  }
`

  const [loading, data] = useQuery(GET_PROFILE)

  // Display a message while the query is in progress
  if (loading) return Loading...

  // Render the user's name from the response
  return Welcome back [data.profile.name]!

}
```