diff --git a/website/versioned_docs/version-v14.0.0/tutorial/queries-2.md b/website/versioned_docs/version-v14.0.0/tutorial/queries-2.md index 5b7da89255620..ddfe9c04388bc 100644 --- a/website/versioned_docs/version-v14.0.0/tutorial/queries-2.md +++ b/website/versioned_docs/version-v14.0.0/tutorial/queries-2.md @@ -227,7 +227,7 @@ Relay will garbage-collect nodes from the Store if they aren’t “reachable”
Deep dive: Why GraphQL Needs a Syntax for Variables -You might be wondering why GraphQL even has the concept of variables, instead of just interpolating the value of the variables into the query string. Well, [as mentioned before](../queries-1), the text of the GraphQL query string isn’t available at runtime, because Relay replaces it with a data structure that is more efficient. You can also configure Relay to use *prepared queries*, where the compiler uploads each query to the server at build time and assigns it an ID — in that case, at runtime, Relay is just telling the server “Give me query #1337”, so string interpolation isn't possible and therefore the variables have to come out of band. Even when the query string is available, passing variable values separately eliminates any issues with serializing arbitrary values and escaping strings, above what is required with any HTTP request. +You might be wondering why GraphQL even has the concept of variables, instead of just interpolating the value of the variables into the query string. Well, [as mentioned before](../queries-1), the text of the GraphQL query string isn’t available at runtime, because Relay replaces it with a data structure that is more efficient. You can also configure Relay to use [persisted queries](../guides/persisted-queries.md), where the compiler uploads each query to the server at build time and assigns it an ID — in that case, at runtime, Relay is just telling the server “Give me query #1337”, so string interpolation isn't possible and therefore the variables have to come out of band. Even when the query string is available, passing variable values separately eliminates any issues with serializing arbitrary values and escaping strings, above what is required with any HTTP request.
* * *