{"id":15668866,"url":"https://github.com/jaydenseric/graphql-http-test","last_synced_at":"2025-05-06T19:48:22.815Z","repository":{"id":57253469,"uuid":"243035280","full_name":"jaydenseric/graphql-http-test","owner":"jaydenseric","description":"A JavaScript API and CLI to test a GraphQL server for GraphQL over HTTP spec compliance.","archived":false,"fork":false,"pushed_at":"2020-07-28T15:18:39.000Z","size":80,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T13:45:16.960Z","etag":null,"topics":["graphql","node","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jaydenseric"}},"created_at":"2020-02-25T15:33:54.000Z","updated_at":"2022-04-17T02:31:27.000Z","dependencies_parsed_at":"2022-08-31T22:11:07.680Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/graphql-http-test","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-http-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-http-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-http-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-http-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/graphql-http-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252758427,"owners_count":21799846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","node","npm"],"created_at":"2024-10-03T14:20:22.785Z","updated_at":"2025-05-06T19:48:22.790Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jaydenseric"],"categories":[],"sub_categories":[],"readme":"# graphql-http-test\n\n[![npm version](https://badgen.net/npm/v/graphql-http-test)](https://npm.im/graphql-http-test) [![CI status](https://github.com/jaydenseric/graphql-http-test/workflows/CI/badge.svg)](https://github.com/jaydenseric/graphql-http-test/actions)\n\nA JavaScript [API](#api) and [CLI](#cli) to test a GraphQL server for [GraphQL over HTTP spec](https://github.com/graphql/graphql-over-http) compliance.\n\n## Setup\n\nTo install from [npm](https://npmjs.com) run:\n\n```sh\nnpm install graphql-http-test --save-dev\n```\n\nUse either the [CLI](#cli) command [`graphql-http-test`](#command-graphql-http-test) or the [API](#api) function [`graphqlHttpTest`](#function-testgraphqlhttp) to test your GraphQL server.\n\n## Support\n\n- Linux, macOS.\n- Node.js `^10.17.0 || ^12.0.0 || \u003e= 13.7.0`.\n\n## CLI\n\n### Command graphql-http-test\n\nThe `graphql-http-test` command tests that a GraphQL server at a given URI is [GraphQL over HTTP spec](https://github.com/graphql/graphql-over-http) compliant. It outputs test results to `stdout` and `stderror` accordingly, and exits with status `1` if tests failed.\n\nIt implements the function [`graphqlHttpTest`](#function-testgraphqlhttp) and has one argument; the GraphQL server URI.\n\n[npx](https://npm.im/npx) example:\n\n```sh\nnpx graphql-http-test http://localhost:3001/graphql\n```\n\n## API\n\n### Table of contents\n\n- [function graphqlHttpTest](#function-graphqlhttptest)\n- [function reportAuditResult](#function-reportauditresult)\n- [type AuditResult](#type-auditresult)\n- [type AuditResultStatus](#type-auditresultstatus)\n\n### function graphqlHttpTest\n\nAudits that a GraphQL server at a given URI is [GraphQL over HTTP spec](https://github.com/graphql/graphql-over-http) compliant.\n\n| Parameter | Type   | Description         |\n| :-------- | :----- | :------------------ |\n| `uri`     | string | GraphQL server URI. |\n\n**Returns:** Promise\u0026lt;[AuditResult](#type-auditresult)\u003e — Resolves once tests are complete.\n\n#### Examples\n\n_Ways to `import`._\n\n\u003e ```js\n\u003e import { graphqlHttpTest } from 'graphql-http-test';\n\u003e ```\n\u003e\n\u003e ```js\n\u003e import graphqlHttpTest from 'graphql-http-test/public/graphqlHttpTest.js';\n\u003e ```\n\n_Ways to `require`._\n\n\u003e ```js\n\u003e const { graphqlHttpTest } = require('graphql-http-test');\n\u003e ```\n\u003e\n\u003e ```js\n\u003e const graphqlHttpTest = require('graphql-http-test/public/graphqlHttpTest');\n\u003e ```\n\n---\n\n### function reportAuditResult\n\nReports the result of an audit in a human readable format either to `stderr` if the root audit has an `error` status, or else to `stdout`. Only intended for use in a Node.js environment.\n\n| Parameter     | Type                             | Description      |\n| :------------ | :------------------------------- | :--------------- |\n| `auditResult` | [AuditResult](#type-auditresult) | An audit result. |\n\n#### Examples\n\n_Ways to `import`._\n\n\u003e ```js\n\u003e import { reportAuditResult } from 'graphql-http-test';\n\u003e ```\n\u003e\n\u003e ```js\n\u003e import reportAuditResult from 'graphql-http-test/public/reportAuditResult.js';\n\u003e ```\n\n_Ways to `require`._\n\n\u003e ```js\n\u003e const { reportAuditResult } = require('graphql-http-test');\n\u003e ```\n\u003e\n\u003e ```js\n\u003e const reportAuditResult = require('graphql-http-test/public/reportAuditResult');\n\u003e ```\n\n---\n\n### type AuditResult\n\nAn audit result.\n\n**Type:** object\n\n| Property | Type | Description |\n| :-- | :-- | :-- |\n| `description` | string | Audit description. |\n| `status` | [AuditResultStatus](#type-auditresultstatus) | Audit result status. |\n| `children` | Array\u0026lt;[AuditResult](#type-auditresult)\u003e? | Child audit results. |\n\n---\n\n### type AuditResultStatus\n\nAn audit result status.\n\n**Type:** `ok` | `warn` | `error`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fgraphql-http-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Fgraphql-http-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fgraphql-http-test/lists"}