From 231b607ef8bb4d543f6bcc3dce677c3ceb050cbb Mon Sep 17 00:00:00 2001 From: Claire Waters Date: Tue, 11 May 2021 10:32:53 -0500 Subject: [PATCH 1/2] edits based on stephane's PR --- .../tutorials/build-your-own-analytics/index.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md b/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md index c433c072fe0..6370d859605 100644 --- a/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md +++ b/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md @@ -5,14 +5,19 @@ order: 40 # Build your own Analytics dashboard -In this example, we're going to see how to use the GraphQL Analytics API to build your own dashboard. This tutorial walks you through building a simple line chart for your Cloudflare zone, using a bit of HTML, JavaScript, AJAX and chart.js. +In this example, we're going to see how to use the GraphQL Analytics API to build your own dashboard. This tutorial walks you through building a simple line chart for your Cloudflare zone using a bit of HTML, JavaScript, AJAX, and chart.js. ![GraphQL recipe](../static/graphQL-recipe-cacheVisual.gif) -The following code will build a page with all the requirement to fetch from GraphQL and plot the cached and uncached bandwidth for the given zone. You'll just need to enter your email address, API token, and your zone ID, and then push the `Fetch analytics` button. +The following code will build a page with all the requirements to fetch from GraphQL and plot the cached and uncached bandwidth for the given zone. You'll just need to enter your email address, API token, and your zone ID, and then push the `Fetch analytics` button. ## Code + + +Cloudflare's [GraphQL endpoint](https://api.cloudflare.com/client/v4/graphql) does not set any CORS headers. Add an endpoint that can proxy the requests back to the API to avoid encountering CORS errors. In the following example, this hostname is referred to as **api.yourdomain.com**. + + ```html From 78d858d78438b13e701f82022087af7285ac5bfb Mon Sep 17 00:00:00 2001 From: Claire Waters Date: Tue, 11 May 2021 10:39:27 -0500 Subject: [PATCH 2/2] aside type fix --- .../graphql-api/tutorials/build-your-own-analytics/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md b/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md index 6370d859605..6fd77dc6783 100644 --- a/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md +++ b/products/analytics/src/content/graphql-api/tutorials/build-your-own-analytics/index.md @@ -13,10 +13,10 @@ The following code will build a page with all the requirements to fetch from Gra ## Code - + ```html