Manuals / API Testing / Chapter 10

E · Advanced · advanced · Week 8 · Chapter 10 of 11

GraphQL testing basics

Many teams use GraphQL. Testing differs from REST — queries, mutations, errors array, and no over-fetching assertions.

Path progress
85%

Step 1 of 3

First GraphQL query

POST to /graphql with { "query": "{ users { id name } }" }. Single endpoint, typed schema.

First GraphQL queryDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →First GraphQL querdrag · tap →Try thisdrag · tap →Follow the dashed drag · tap →

Do this now

Use Postman GraphQL mode or curl against a public GraphQL API (e.g. SpaceX demo).

Was this step clear?
Chapter learning outcomes
  • Query vs mutation
  • GraphQL errors format
  • Postman GraphQL
  • When REST vs GraphQL tests differ

Clear these before you leave

Side quest

Mutation test

If API supports mutation, create and verify resource.