# Lesson 5.1 - Add a remote source

Connect the HyDemoAPI REST endpoint to the project schema and define the custom types Hygraph needs to query it as native GraphQL.

In this lesson, you will add a remote source to the project schema. Before this step, the schema only returns data stored in Hygraph. After it, the schema includes queryable types from an external REST API that can be fetched alongside Hygraph content.

A remote source is a custom resolver entry point in the schema. It accepts field values from other Hygraph fields as arguments, which is what makes it possible to fetch reviews scoped to a specific product in lesson 5.2.

## Configure the remote source

You will connect a REST API using the Hygraph demo API.

[Video: Configuring the remote source](https://eu-central-1-shared-euc1-02.graphassets.com/AvHQ3RDvFSousA8iwElOKz/cmnn9whe6htpu07vxptrtlej3)

1. Navigate to the **Schema editor** and click **+Add** next to **Remote Sources**.
2. Fill in the following information:

    | Field | Input |
    |---|---|
    | Select remote source type | Custom source |
    | Display Name | HyDemoAPI |
    | Type | REST |
    | Base URL | `https://demo-api.hygraph.workers.dev` |

    The base URL is the root endpoint for all remote fields that use this source. Individual remote fields append their own paths to this base.

3. Click **Add** to save the remote source configuration before adding type definitions.

## Add custom type definitions

REST APIs return fixed data structures. To query a REST API as if it were native GraphQL, Hygraph needs to know the shape of the data it will receive. Custom type definitions provide that shape using GraphQL SDL.

**What is SDL?:**
SDL stands for Schema Definition Language. It is the syntax used to define types and their fields in a GraphQL schema. The type definitions added here describe the structure of the data the `HyDemoAPI` returns, so Hygraph can expose those types in the project's GraphQL schema.

1. For each type definition, click **+Add custom type definition** and paste the snippets:

      **Review**

    ```GraphQL
    type Review {
      id: Int
      name: String
      product: String
      rating: Float
      comment: String
    }
    ```

      
      **Reviews**

    ```GraphQL
    type Reviews {
      data: [Review]
    }
    ```


2. Click **Add Remote Source** to save the configuration.

Your finished remote source should look like this:

[Video: Finished remote source](https://eu-central-1-shared-euc1-02.graphassets.com/AvHQ3RDvFSousA8iwElOKz/cmnn9x8mehu3j07vx7uzhl9ex)

The `Reviews` type wraps a list of `Review` entries. These two types are used by the remote fields in lessons 5.2 and 5.3.

## What's next

[Lesson 5.2 - Add remote fields](https://hygraph.com/docs/getting-started/tutorial/tutorial-add-remote-fields)

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