Load Production GraphQL APIs on Local or Staging Frontends using Replace Rule

Requestly
Requestly
Published in
Mar 14, 2024

--

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.

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
  4. URL and enter the Production URL in the field given below.
  5. Mock Server and select a Mock API if you want to load mock API responses.
  6. Save and test the rule.

--

--

Requestly
Requestly

Setup redirects, modify headers, switch hosts, insert user scripts and much more. Install it on Chrome & Firefox and join our family of more than 100,000 devs!