# Lesson 5.3 - Add top-level remote fields

Add a top-level remote field to the Query model and run a test query to confirm the remote source returns review data through the Hygraph API.

In this lesson, you will add a top-level remote field to the **Query** system model and run a test query to confirm the remote source is working correctly.

A top-level remote field fetches remote data outside the context of any model entry. Where the remote field added in lesson 5.2 only returns reviews for a specific product, a top-level remote field can return review data independently. This is useful for fetching all reviews, or for passing in an argument from the frontend rather than from a content entry.

## Add a top-level remote field

You will add the field to the **Query** system model using the same `HyDemoAPI` remote source.

![Complete top-level remote field configuration](https://hygraph.com/images/docs/getting-started/top-level-remote-field.png)

1. Open the **Query** model in the Schema editor and from the right sidebar, add a **REST** remote field.
2. Fill in the following information:

    | Field | Input |
    |---|---|
    | Display name | Reviews |
    | API ID | Auto-completed. Leave as is. |
    | Remote source | HyDemoAPI is selected by default. Leave as is. |
    | Method | GET is selected by default. Leave as is. |
    | Return type | Select `Reviews` from the dropdown |
    | Input arguments | Click **+ Add input argument** to reveal the argument fields |
    | Input type | String |
    | API ID | productSlug |
    | Make field required | Select checkbox |
    | Path | `/api/reviews/product/{{args.productSlug}}` |

    The `Path` appends to the remote source base URL. The `{{args.productSlug}}` path argument is supplied by whoever runs the query: a frontend component, a developer testing in the API Playground, or any API client. This means the top-level remote field has no dependency on Hygraph content. It can be queried even if the `Product` model contains no entries at all.

    The remote field in [lesson 5.2](https://hygraph.com/docs/getting-started/tutorial/tutorial-add-remote-fields#add-a-remote-field-to-the-product-model) works differently. Its path uses `{{doc.productSlug}}`, which pulls the `productSlug` value from the specific `Product` entry being queried. The top-level remote field removes that dependency entirely.

3. Click **Add** to save.

## Test the top-level remote field

Because the top-level remote field is not connected to a content entry, it can be tested immediately without creating any content first.

1. Navigate to the **API Playground**.
2. Run the following query:

      **Query**

    ```graphql
    query MyQuery {
      reviews(productSlug: "plaid-shirt") {
        data {
          comment
          id
          name
          product
          rating
        }
      }
    }
    ```

      
      **Response**

    ```json
    {
      "data": {
        "reviews": {
          "data": [
            {
              "comment": "After wearing this shirt for 2 days, I realized it was made of cotton. I am allergic to cotton.",
              "id": 3,
              "name": "Oregon Person",
              "product": "plaid-shirt",
              "rating": 1.5
            },
            {
              "comment": "This shirt is okay. It lost a button, but I sewed it back on.",
              "id": 6,
              "name": "Another Person",
              "product": "plaid-shirt",
              "rating": 3.5
            },
            {
              "comment": "I love this shirt. I wear it all the time.",
              "id": 7,
              "name": "Third Person",
              "product": "plaid-shirt",
              "rating": 4.5
            }
          ]
        }
      }
    }
    ```


The response confirms the remote source is correctly configured. The Hygraph API returns external review data without any data migration and without a separate API call from the frontend. This is [Content Federation](https://hygraph.com/docs/core-concepts/content-federation) working as intended.

The schema is now complete. Content creation starts in the next lesson.

## What's next

[Lesson 6 - Content](https://hygraph.com/docs/getting-started/tutorial/tutorial-content-overview)

Or, go to the [Tutorial overview](https://hygraph.com/docs/getting-started/tutorial/tutorial-overview) for the full lesson list.
