# Fetching data from third party GraphQL endpoint inside the resolver

**URL:** <https://community.apollographql.com/t/fetching-data-from-third-party-graphql-endpoint-inside-the-resolver/5714>\
**Category:** Server\
**Tags:** server\
**Created:** [February 14, 2023, 5:17am UTC](https://community.apollographql.com/t/fetching-data-from-third-party-graphql-endpoint-inside-the-resolver/5714 "2023-02-14T05:17:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravish-goel](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/ravish-goel/32/3877_2.png) [@ravish-goel](https://community.apollographql.com/u/ravish-goel)\
**Post date:** [February 14, 2023, 5:17am UTC](https://community.apollographql.com/t/fetching-data-from-third-party-graphql-endpoint-inside-the-resolver/5714/1 "2023-02-14T05:17:57Z")

</div>

In my GraphQL server I want to fetch data from a third party GraphQL endpoint and return the same data from it’s resolver. Is schema delegation used to achieve this?

---

<div class="post-metadata">

**Author:** ![watson](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/watson/32/2053_2.png) [@watson](https://community.apollographql.com/u/watson)\
**Post date:** [February 14, 2023, 5:45pm UTC](https://community.apollographql.com/t/fetching-data-from-third-party-graphql-endpoint-inside-the-resolver/5714/2 "2023-02-14T17:45:15Z")

</div>

Hi @ravish-goel 👋 , there are a couple options you have here. You can accomplish this with [Apollo Federation](https://www.apollographql.com/docs/federation/federated-types/overview) and you can combine the remote 3rd party endpoint. You can try this out with `rover dev` or a Cloud Router instance.

**Using the Cloud Router - _use this if you have your GraphQL server hosted_**

1. [Create your supergraph with GraphOS](https://www.apollographql.com/docs/graphos/quickstart/cloud). You can use the 3rd party endpoint as your first graph  
_Note: you might need to [configure your cloud router](https://www.apollographql.com/docs/graphos/routing/cloud-configuration) for authentication rules if the 3rd party API requires it_
2. Navigate to the “Subgraphs” tab in Apollo Studio and add your GraphQL server (see image)  
 ![Screenshot 2023-02-14 at 9.39.42 AM](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/a/a0a9aa02a262a23a09c34f99203c57367006c01c.png)
3. Once you’ve added your subgraph, head to the Apollo Explorer tab (the play button above the subgraphs tab) and try running a query across subgraphs

**Using `rover dev` - _use this if your GraphQL server is only available locally (currently in development)_**

1. Install [`rover`](https://www.apollographql.com/docs/rover/getting-started)
2. In a terminal window, run `rover dev --name=3rd-party --url=https://3rd-party.com/api/graphql` (make sure to replace the URL with your 3rd party endpoint)  
_Note: if the 3rd party endpoint doesn’t support introspection, you can use a local schema file and add --schema=schema.graphql to the above command. You may also need to [configure authentication](https://www.apollographql.com/docs/rover/commands/dev#advanced-configuration) for `rover dev` if the 3rd party API requires it_
3. In a new terminal window, run `rover dev --name=my-service --url=http://localhost:4000` (make sure to replace the URL with your locally running GraphQL server
4. Open up [http://localhost:3000](http://localhost:3000) and try running a query across your graphs.

I hope this helps. If you want to dive into it deeper or walk through an example, we started up an [Apollo Discord server](https://discord.gg/graphos) and you can ping me (@watson) to talk more. Hope to see you there!
