{"id":47951,"library":"graphql-tester","title":"GraphQL Tester","description":"A test framework for executing integration tests against GraphQL services. Current version 0.0.5 uses Promises and supports HTTP POST with configurable endpoint, method, and content type. It returns structured responses with success, status, headers, data, and errors. Differentiators include promise-based chaining usable with Mocha and optional application server integration. Release cadence is irregular (no recent updates).","status":"active","version":"0.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/sazzer/graphql-tester","tags":["javascript","graphql","test"],"install":[{"cmd":"npm install graphql-tester","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-tester","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-tester","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import used in examples; CommonJS require works but may fail in strict ESM environments.","wrong":"const { tester } = require('graphql-tester');","symbol":"tester","correct":"import { tester } from 'graphql-tester';"},{"note":"CommonJS require is valid for Node < 12 or when using --require.","wrong":null,"symbol":"tester","correct":"const { tester } = require('graphql-tester');"},{"note":"Default export is also available as a function; named export is preferred.","wrong":"import { tester } from 'graphql-tester';","symbol":"default","correct":"import tester from 'graphql-tester';"}],"quickstart":{"code":"import { tester } from 'graphql-tester';\n\nconst test = tester({\n  url: process.env.GRAPHQL_URL || 'http://localhost:4000/graphql',\n});\n\nasync function run() {\n  const response = await test('{ hello }');\n  console.log(response.success, response.data);\n}\n\nrun().catch(console.error);","lang":"javascript","description":"Shows creating a tester with optional URL from env, executing a GraphQL query, and accessing response fields."},"warnings":[{"fix":"Check response.success or response.errors to distinguish client errors.","message":"The tester function returns a promise that resolves even for HTTP errors (e.g., 400) as long as the GraphQL response contains an 'errors' field.","severity":"gotcha","affected_versions":">=0.0.5"},{"fix":"Confirm server supports GET requests with GraphQL.","message":"Default HTTP method is POST, but if you set method: 'GET', the query string is sent as a URL query parameter ?query=... – ensure your server supports GET for GraphQL.","severity":"gotcha","affected_versions":">=0.0.5"},{"fix":"Avoid using the 'server' option unless you manage server lifecycle externally.","message":"The 'server' option starts a child process before tests; it may not work with all application servers and can cause hanging if the server doesn't exit cleanly.","severity":"gotcha","affected_versions":">=0.0.5"},{"fix":"Access raw response via 'raw' property if you need original response details.","message":"Content-Disposition header is not returned in 'headers' – only response.headers from the HTTP library is passed through.","severity":"gotcha","affected_versions":">=0.0.5"}],"env_vars":null,"search_vec":"'0.0.5':15 'applic':51 'base':44 'cadenc':55 'chain':45 'configur':23 'content':27 'current':13 'data':37 'differenti':40 'endpoint':24 'error':39 'execut':7 'framework':5 'graphql':1,11,62 'header':36 'http':20 'includ':41 'integr':8,53 'irregular':57 'javascript':61 'method':25 'mocha':48 'option':50 'post':21 'promis':17,43 'promise-bas':42 'recent':59 'releas':54 'respons':32 'return':30 'server':52 'servic':12 'status':35 'structur':31 'success':34 'support':19 'test':4,9,63 'tester':2 'type':28 'updat':60 'usabl':46 'use':16 'version':14","created_at":"2026-06-07T16:54:09.987275+00:00","updated_at":"2026-06-07T16:54:09.987275+00:00","problems":[{"fix":"Use 'import { tester } from \"graphql-tester\"' or 'const { tester } = require(\"graphql-tester\")'.","cause":"Importing the default export incorrectly or using CommonJS require without destructuring.","error":"tester is not a function"},{"fix":"Set NODE_TLS_REJECT_UNAUTHORIZED=0 (only for testing) or configure the server with a valid certificate.","cause":"Using HTTPS with a self-signed certificate; node rejects by default.","error":"self signed certificate in certificate chain"},{"fix":"Ensure your GraphQL server is running on the expected host and port.","cause":"No server running at the specified URL.","error":"connect ECONNREFUSED"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sazzer/graphql-tester#readme","github":"https://github.com/sazzer/graphql-tester","docs":null,"changelog":null,"pypi":null,"npm":"graphql-tester","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}