diff --git a/docs/01-getting-started/04-using-the-enjin-platform.md b/docs/01-getting-started/04-using-the-enjin-platform.md index a5aaf40..14765ee 100644 --- a/docs/01-getting-started/04-using-the-enjin-platform.md +++ b/docs/01-getting-started/04-using-the-enjin-platform.md @@ -101,6 +101,30 @@ Once you're satisfied with the options, click the "**Create**" button at the bot Click **View Transaction** to jump straight to the Transactions page and watch it move from `PENDING` → `BROADCAST` → `FINALIZED` as the daemon signs and the chain finalizes it. +### From the Dashboard to the API: View the GraphQL Request {#view-graphql-request} + +Everything the dashboard does is just a GraphQL request under the hood. Any transaction you can build in the UI can show you the exact mutation it would send — so you can prototype an action visually, then lift the request straight into your app integration instead of writing it from scratch. + +On any transaction form — whether a guided flow or the transaction builder — click the **dropdown caret (▾)** next to the **Create** (or **+ Add to Batch**) button and choose **View GraphQL Request**. + +![The Create Token button with its dropdown open, showing the View GraphQL Request option](/img/getting-started/v3-view-graphql-request-button.png) + +The popup gives you everything needed to reproduce the request programmatically: + +- **URL** — the GraphQL endpoint the request is sent to (`https://platform.beta.enjin.io/graphql`). +- **Request** — the GraphQL mutation, including its variable definitions. +- **Variables** — the JSON variable values for this specific transaction. + +Each block has its own **Copy** button. The **Copy** button's dropdown also offers **Copy as cURL**, and you can **Execute** the request directly from the popup to run it without leaving the page. + +:::note +**Copy as cURL** doesn't include your API token — the copied command has a `` placeholder. Replace it with a valid API token generated under **Settings → API Tokens** before running the request. +::: + +![The View GraphQL Request popup showing the URL, the mutation, and its variables](/img/getting-started/v3-view-graphql-request-popup.png) + +This works for both single and batch transactions. Copy the **Request** and **Variables** to build the same mutation in your own code — see [Using the Enjin API](/01-getting-started/05-using-enjin-api/05-using-enjin-api.md) for how to send it. + ### Option B. Using the Enjin API & SDKs To create a Platform request programmatically, use the API, or one of the s. diff --git a/docs/01-getting-started/05-using-enjin-api/01-how-to-use-graphql.md b/docs/01-getting-started/05-using-enjin-api/01-how-to-use-graphql.md index c01adce..c8d787d 100644 --- a/docs/01-getting-started/05-using-enjin-api/01-how-to-use-graphql.md +++ b/docs/01-getting-started/05-using-enjin-api/01-how-to-use-graphql.md @@ -20,7 +20,7 @@ To illustrate the differences between GraphQL and RESTful API calls, let's consi In a typical RESTful API, you might have an endpoint like `/mintToken` with a POST request that includes the necessary data in the request body. This might look something like: ```http -POST https://platform.beta.enjin.io/api/mintToken +POST https://example.com/api/mint-token Content-Type: application/json { diff --git a/docs/01-getting-started/05-using-enjin-api/05-using-enjin-api.md b/docs/01-getting-started/05-using-enjin-api/05-using-enjin-api.md index a82407b..7df9749 100644 --- a/docs/01-getting-started/05-using-enjin-api/05-using-enjin-api.md +++ b/docs/01-getting-started/05-using-enjin-api/05-using-enjin-api.md @@ -21,6 +21,10 @@ If you're more familiar with REST APIs, it's important to understand that our AP We recommend reviewing our [How to Use GraphQL guide](/01-getting-started/05-using-enjin-api/01-how-to-use-graphql.md) to get started quickly and effectively. ::: +:::tip Don't write mutations from scratch +Anything you can do in the Platform dashboard can reveal its exact GraphQL request. Build the action in the UI, then use **View GraphQL Request** to copy the mutation and variables straight into your app. See [From the Dashboard to the API](/01-getting-started/04-using-the-enjin-platform.md#view-graphql-request). +::: + ## Authentication API tokens are used to authenticate your application's requests to the Enjin Platform. They serve a dual purpose: diff --git a/static/img/getting-started/v3-view-graphql-request-button.png b/static/img/getting-started/v3-view-graphql-request-button.png new file mode 100644 index 0000000..456b0a0 Binary files /dev/null and b/static/img/getting-started/v3-view-graphql-request-button.png differ diff --git a/static/img/getting-started/v3-view-graphql-request-popup.png b/static/img/getting-started/v3-view-graphql-request-popup.png new file mode 100644 index 0000000..88c1507 Binary files /dev/null and b/static/img/getting-started/v3-view-graphql-request-popup.png differ