How to Load Staging GraphQL APIs on Local Apps

Load Production GraphQL APIs on Local or Staging Frontends

Once you understand how to debug and override GraphQL API using Requestly. You might want to explore how you can use Requestly in different scenarios of your development cycle(SDLC). Let’s explore how you can speed up your local development using the Replace Rule.

Setting up a local GraphQL server is challenging with multiple data sources and models. You can eliminate the extensive time and effort required to create and update your local environment with Requestly’s Replace Rule. You can also use production APIs on the staging front end to use more stable APIs.

Video Tutorial

Steps to Create Replace Rule

Follow the below steps to load production APIs on local or staging environments.

  1. Create a new Replace Rule.
  2. Use your local or staging API hostname & path as source conditions like – company.com/api/graphql
  3. Under Redirect to select
    1. URL and enter the Production URL in the field given below.
    2. Mock Server and select a Mock API if you want to load mock API responses.
  4. Save and test the rule.

Further Reading

Learn How to make non-intrusive GraphQL API mocks

Share this article:

Subscribe to our weekly newsletter !

Join 10k developers and QAs to get weekly updates with Requestly's newsletter.​

This article was written by:

Picture of Abhishek Sachan

Abhishek Sachan

Abhishek is Growth Engineer at Requestly and has profound love for programming.

Join 10k developers and get weekly updates with Requestly's newsletter.

Contents