Apply access checks to the data
A single GraphQL endpoint can read many types of records. Check that each resolver enforces the user’s permission for the requested object and field.
Do not rely on hidden fields in the front end. A client can send a query that the user interface does not show.
Control query cost and errors
Set limits for query depth, complexity, response size and request rate. Use timeouts for expensive operations. Avoid returning detailed internal errors to public clients.
Review batching and nested queries. A small request can trigger many database operations if the server does not control query cost.
Test role combinations
Use accounts with different roles and try to read or change each sensitive object. Check mutations as well as queries.
Review schema exposure and production settings based on the application’s design. Include GraphQL in API security testing when it handles important data or actions.
