Complete the code to define a persisted query with a unique ID.
query GetUser($id: ID!) { user(id: [1]) { name email } }The variable $id is used as the argument for the user query to fetch the user by ID.
Complete the code to specify the hash key for a persisted query.
persistedQueries: { version: 1, [1]: "abc123def456" }The sha256HashHex key is used to specify the SHA-256 hash in hexadecimal format for the persisted query.
Fix the error in the persisted query registration code.
persistedQueries.register({ id: "[1]", query: "{ user { id name } }" })The ID for persisted queries should be a consistent string identifier, often using underscores for readability like user_query.
Fill both blanks to complete the persisted query fetch with variables.
client.query({ query: [1], variables: [2] })The query should be the persisted query constant GET_USER_QUERY, and variables should be an object with the user ID.
Fill all three blanks to define and use a persisted query with a hash and variables.
const persistedQuery = { id: [1], sha256HashHex: [2], query: [3] }The id is a string identifier like "get_user", the sha256HashHex is the hash string, and the query is the GraphQL query string using template literals.