From 9ac4196186b047f7f3a9eb4f24de25ced9ef7dae Mon Sep 17 00:00:00 2001 From: rudney5000 Date: Thu, 29 Oct 2026 16:33:33 +0300 Subject: [PATCH] Fix callout: variables don't require a named operation --- src/pages/learn/queries.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/learn/queries.mdx b/src/pages/learn/queries.mdx index d1f25c70ec..4229120b29 100644 --- a/src/pages/learn/queries.mdx +++ b/src/pages/learn/queries.mdx @@ -158,7 +158,7 @@ query HeroNameAndFriends($episode: Episode) { ``` -You must specify an operation type and name in a GraphQL document to use variables. +To use variables, you must specify the operation type (for example, `query`), because the shorthand syntax cannot declare variables. Naming the operation is recommended, but it is not required to use variables. Now, in our client code, we can simply pass a different variable rather than needing to construct an entirely new query. In general, this is also a good practice for denoting which arguments in our query are expected to be dynamic—we should never be doing string interpolation to construct queries from user-supplied values.