From 497aa7b4270e92733a8c373ae487112ad4699299 Mon Sep 17 00:00:00 2001 From: Dennis Date: Fri, 13 Oct 2023 11:35:30 -0600 Subject: [PATCH 1/2] Update fragment's definition in Learn-Queries.md Changing the wording on the description of fragments to nudge people towards a more clear usage, like what Relay.dev does. --- src/content/learn/Learn-Queries.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/learn/Learn-Queries.md b/src/content/learn/Learn-Queries.md index ae3f69f546..5255296d2d 100644 --- a/src/content/learn/Learn-Queries.md +++ b/src/content/learn/Learn-Queries.md @@ -110,6 +110,7 @@ That's why GraphQL includes reusable units called _fragments_. Fragments let you } } +# used by the comparison UI component fragment comparisonFields on Character { name appearsIn @@ -119,7 +120,7 @@ fragment comparisonFields on Character { } ``` -You can see how the above query would be pretty repetitive if the fields were repeated. The concept of fragments is frequently used to split complicated application data requirements into smaller chunks, especially when you need to combine lots of UI components with different fragments into one initial data fetch. +You can see how the above query would be pretty repetitive if the fields were repeated. The concept of fragments is frequently used to define data requirements of a UI component or utility, creating smaller composable chunks. This is especially beneficial when you need to combine lots of UI components with different fragments into one initial data fetch. ### Using variables inside fragments From bca76f98740b439ae6a1df5c2198b4ff4d7f1162 Mon Sep 17 00:00:00 2001 From: Dennis Date: Mon, 16 Oct 2023 12:01:07 -0600 Subject: [PATCH 2/2] Update src/content/learn/Learn-Queries.md Updating the comment to be correct and clear. Co-authored-by: Benjie --- src/content/learn/Learn-Queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/Learn-Queries.md b/src/content/learn/Learn-Queries.md index 5255296d2d..c29925ad63 100644 --- a/src/content/learn/Learn-Queries.md +++ b/src/content/learn/Learn-Queries.md @@ -110,7 +110,7 @@ That's why GraphQL includes reusable units called _fragments_. Fragments let you } } -# used by the comparison UI component +# used by the character-rendering UI component fragment comparisonFields on Character { name appearsIn