cy.intercept not matching a specific GraphQL mutation
cypressgraphqlnetwork
Accepted solution
Match on the request body inside cy.intercept using a function. Do NOT rely on url-only matching for GraphQL. This lets you stub exactly the CreateOrder mutation and leave the rest untouched.
Most helpful answer
One more nice pattern: keep the matcher in a helper so multiple specs can stub the same mutation without duplicating body inspection code.