From bfaa261823e57fc76d9d5057d1e8dd6d9ad68b27 Mon Sep 17 00:00:00 2001 From: Hitarth Sharma Date: Sat, 14 Jul 2018 22:50:45 +1000 Subject: [PATCH 1/3] Update StaticQuery documentation To explicitly make it clear that StaticQuery should NOT be used on page components and doing so will result in a Loading (StaticQuery) message showing up on the page. --- docs/docs/static-query.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/static-query.md b/docs/docs/static-query.md index 75c81ebd87f3f..51ba7a8821610 100644 --- a/docs/docs/static-query.md +++ b/docs/docs/static-query.md @@ -2,7 +2,7 @@ title: "Querying data in non-page components using StaticQuery" --- -Gatsby v2 introduces `StaticQuery`, a new API that allows non-page components to retrieve data via GraphQL query. +Gatsby v2 introduces `StaticQuery`, a new API that allows **non-page components** to retrieve data via GraphQL query. Using this on page components will result in the message `Loading (StaticQuery)` showing up on your pages. ## Basic example From 089754b42419be300e49d83bf56f87203b11b670 Mon Sep 17 00:00:00 2001 From: Hitarth Sharma Date: Sat, 14 Jul 2018 22:55:35 +1000 Subject: [PATCH 2/3] Update static-query.md --- docs/docs/static-query.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/static-query.md b/docs/docs/static-query.md index 51ba7a8821610..9d1183e0bfeb2 100644 --- a/docs/docs/static-query.md +++ b/docs/docs/static-query.md @@ -2,7 +2,7 @@ title: "Querying data in non-page components using StaticQuery" --- -Gatsby v2 introduces `StaticQuery`, a new API that allows **non-page components** to retrieve data via GraphQL query. Using this on page components will result in the message `Loading (StaticQuery)` showing up on your pages. +Gatsby v2 introduces `StaticQuery`, a new API that allows **only non-page components** to retrieve data via GraphQL query. Please note that attempting to use this on a page component will result in the message `Loading (StaticQuery)` showing up on your pages. ## Basic example From 136cba431b8fab394c89ebcec31a5db690ba4904 Mon Sep 17 00:00:00 2001 From: Hitarth Sharma Date: Sat, 14 Jul 2018 22:58:19 +1000 Subject: [PATCH 3/3] Update static-query.md --- docs/docs/static-query.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/static-query.md b/docs/docs/static-query.md index 9d1183e0bfeb2..5730cc93c46f0 100644 --- a/docs/docs/static-query.md +++ b/docs/docs/static-query.md @@ -2,7 +2,7 @@ title: "Querying data in non-page components using StaticQuery" --- -Gatsby v2 introduces `StaticQuery`, a new API that allows **only non-page components** to retrieve data via GraphQL query. Please note that attempting to use this on a page component will result in the message `Loading (StaticQuery)` showing up on your pages. +Gatsby v2 introduces `StaticQuery`, a new API that allows **only non-page components** to retrieve data via GraphQL query. Please note that attempting to use this on a page component will result in the message `Loading (StaticQuery)` showing up on the page, as each and every component is allowed to have *only one* query. ## Basic example