Runtime:How to Properly Initiate Requests Using GQL Tools
I. Introduction
This article explains how to properly initiate GraphQL (GQL) requests and addresses common issues encountered when using GQL tools.
II. Parameter Guide
Request URL and Method
Find the requestURL
and HTTP method in the browser's request headers. Ensure the GQL tool uses the exact sameURL
and method as the browser request to communicate with the server correctly.Request Headers Query and Variables
Each GQL request consists of two main parts:- Query: Defines the structure of the data to retrieve.
- Variables: Dynamic parameters for the query (optional).
To replicate a request:
- Right-click on
Query
andVariables
in the browser developer tools. - Select "Copy Value" and paste them into your GQL tool.
Copy Query and Variables
Important Note:
- Admin Accounts: When logged in as an admin, you can omit the
Variables
parameter because admin users bypass permission checks. - Regular Users: Always include the
Variables
parameter. Omitting it will result in permission errors.