<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp" -->

---
title: How to Test GraphQL APIs with Bruno: Queries, Mutations...
description: A hands-on guide to testing GraphQL APIs using Bruno, an open-source API client. It explains why REST testing habits fail with GraphQL (a query can return 200...
canonical: https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Test GraphQL APIs with Bruno: Queries, Mutations &amp; Assertions | daily.dev
og:description: A hands-on guide to testing GraphQL APIs using Bruno, an open-source API client. It explains why REST testing habits fail with GraphQL (a query can return 200...
og:url: https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp
og:image: https://api.daily.dev/og/posts/UmRIZsqyp.png
og:image:alt: How to Test GraphQL APIs with Bruno: Queries, Mutations &amp; Assertions
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Test GraphQL APIs with Bruno: Queries, Mutations & Assertions

**[Bruno Blog](https://daily.dev/sources/usebruno)** · 18 min read · 0 upvotes · 0 comments

## Summary

A hands-on guide to testing GraphQL APIs using Bruno, an open-source API client. It explains why REST testing habits fail with GraphQL (a query can return 200 OK while still failing inside the errors array), then walks through setting up a GraphQL request, writing three-layer assertions (transport, errors, shape/values), using variables and environments, testing mutations by verifying side effects (create, read back, clean up), covering validation/execution/auth error cases via extensions.code, and running the whole collection in CI with the Bruno CLI.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.usebruno.com/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions>

## Questions this post answers

### Why does my GraphQL API return a 200 status even when the query actually failed?

GraphQL can return a 200 OK status while still failing internally because errors are reported inside the response body rather than via HTTP status codes. A resolver throwing an exception, a null returned for a non-nullable field, or a missing permission all get reported in an errors array alongside a 200 status, so checking status alone will let broken responses pass as successful.

_Developers hardening GraphQL test suites can dig deeper into error-handling patterns on daily.dev._

### How should I test a GraphQL mutation to make sure it actually persisted data?

Test a mutation by proving its side effect rather than just checking its response: run the mutation, capture the returned id (for example with bru.setVar() in Bruno), issue a follow-up query for that id to confirm the record exists, then delete it to clean up. A mutation can return a plausible-looking response without the write actually persisting, so a confirming read-back is the reliable check.

_Anyone designing reliable write-path tests can track more API testing patterns on daily.dev._

### What is the difference between validation errors and execution errors in a GraphQL response?

Validation errors occur when a request is malformed, such as a mistyped field name or wrong variable type, and the server rejects it before running anything, typically with a GRAPHQL_VALIDATION_FAILED code and often a 4xx status. Execution errors happen after the query runs, such as a resolver throwing or returning null for a non-nullable field, and are reported in the errors array with a 200 status and a path pointing to the failing field.

_Teams building resilient GraphQL error handling can follow related testing techniques on daily.dev._

## Similar posts on daily.dev

- [How to Test an API Without a Frontend](https://daily.dev/posts/how-to-test-an-api-without-a-frontend-5phbkfhlw) · Bruno Blog · 16 upvotes · 3 comments
- [Angular and GraphQL: From REST to GraphQL Part 1](https://daily.dev/posts/angular-and-graphql-from-rest-to-graphql-part-1-ryvhlfldm) · Telerik · 0 upvotes · 0 comments
- [3 REST API Testing Mistakes That Cost Us the Most Time \(and How We Fixed Them\)](https://daily.dev/posts/3-rest-api-testing-mistakes-that-cost-us-the-most-time-and-how-we-fixed-them--kzo04t39p) · SitePoint · 0 upvotes · 0 comments
- [The GraphQL Goldmine: How to Reverse Engineer APIs for Scraping](https://daily.dev/posts/the-graphql-goldmine-how-to-reverse-engineer-apis-for-scraping-8ti6rqj9d) · Ruby Flow · 1 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#cicd](https://daily.dev/tags/cicd), [#graphql](https://daily.dev/tags/graphql)

[View this post on daily.dev](https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Test GraphQL APIs with Bruno: Queries, Mutations & Assertions","url":"https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp"},"datePublished":"2026-08-23T07:21:18.711Z","dateModified":"2026-08-23T07:25:08.322Z","description":"A hands-on guide to testing GraphQL APIs using Bruno, an open-source API client. It explains why REST testing habits fail with GraphQL (a query can return 200...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/da7decd3cbf51f8a0af63f950fa7f160?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/da7decd3cbf51f8a0af63f950fa7f160?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Bruno Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Bruno Blog","logo":"https://media.daily.dev/image/upload/s--n6YntNuw--/f_auto,q_auto/v1787469611/logos/usebruno?_a=BAMAMicg0","url":"https://daily.dev/sources/usebruno"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,cicd,graphql","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Bruno Blog","item":"https://daily.dev/sources/usebruno"},{"@type":"ListItem","position":3,"name":"How to Test GraphQL APIs with Bruno: Queries, Mutations & Assertions"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-test-graphql-apis-with-bruno-queries-mutations-assertions-umrizsqyp#faq","mainEntity":[{"@type":"Question","name":"Why does my GraphQL API return a 200 status even when the query actually failed?","acceptedAnswer":{"@type":"Answer","text":"GraphQL can return a 200 OK status while still failing internally because errors are reported inside the response body rather than via HTTP status codes. A resolver throwing an exception, a null returned for a non-nullable field, or a missing permission all get reported in an errors array alongside a 200 status, so checking status alone will let broken responses pass as successful. Developers hardening GraphQL test suites can dig deeper into error-handling patterns on daily.dev."}},{"@type":"Question","name":"How should I test a GraphQL mutation to make sure it actually persisted data?","acceptedAnswer":{"@type":"Answer","text":"Test a mutation by proving its side effect rather than just checking its response: run the mutation, capture the returned id (for example with bru.setVar() in Bruno), issue a follow-up query for that id to confirm the record exists, then delete it to clean up. A mutation can return a plausible-looking response without the write actually persisting, so a confirming read-back is the reliable check. Anyone designing reliable write-path tests can track more API testing patterns on daily.dev."}},{"@type":"Question","name":"What is the difference between validation errors and execution errors in a GraphQL response?","acceptedAnswer":{"@type":"Answer","text":"Validation errors occur when a request is malformed, such as a mistyped field name or wrong variable type, and the server rejects it before running anything, typically with a GRAPHQL_VALIDATION_FAILED code and often a 4xx status. Execution errors happen after the query runs, such as a resolver throwing or returning null for a non-nullable field, and are reported in the errors array with a 200 status and a path pointing to the failing field. Teams building resilient GraphQL error handling can follow related testing techniques on daily.dev."}}]}
```

