Complete the code to request the first 5 items using cursor-based pagination.
query { items(first: [1]) { edges { node { id name } } pageInfo { hasNextPage endCursor } } }The first argument specifies how many items to fetch from the start. Using 5 fetches the first 5 items.
Complete the code to fetch the next page of items after a given cursor.
query { items(first: 5, after: "[1]") { edges { node { id name } } pageInfo { hasNextPage endCursor } } }The after argument takes a cursor string to fetch items after that cursor.
Fix the error in the query to correctly request items after a cursor.
query { items(first: 5, after: [1]) { edges { node { id name } } pageInfo { hasNextPage endCursor } } }The cursor value must be a string, so it needs quotes around it in GraphQL queries.
Fill both blanks to request the last 3 items before a cursor.
query { items(last: [1], before: "[2]") { edges { node { id name } } pageInfo { hasPreviousPage startCursor } } }last and before values.first instead of last.The last argument fetches the last N items before the cursor given in before.
Fill all three blanks to request items with filtering and pagination.
query { items(first: [1], after: "[2]", filter: { status: [3] }) { edges { node { id name status } } pageInfo { hasNextPage endCursor } } }after.This query fetches the first 10 items after a cursor, filtering only those with status "ACTIVE".