Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/learn/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ query HeroNameAndFriends($episode: Episode) {
```

<Callout type="info">
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.
</Callout>

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.
Expand Down
Loading