{"id":13516741,"url":"https://github.com/mfix22/gest","last_synced_at":"2025-05-05T16:22:35.408Z","repository":{"id":39006044,"uuid":"84027166","full_name":"mfix22/gest","owner":"mfix22","description":"👨‍💻 A sensible GraphQL testing tool - test your GraphQL schema locally and in the cloud","archived":false,"fork":false,"pushed_at":"2023-01-03T22:58:40.000Z","size":1350,"stargazers_count":146,"open_issues_count":5,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T19:24:51.274Z","etag":null,"topics":["cli","command-line","deployment-testing","gest","graphiql","graphql","graphql-client","integration-testing","jest","regression-testing","test","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mfix22.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["mfix22"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":"https://www.buymeacoffee.com/fix"}},"created_at":"2017-03-06T03:46:18.000Z","updated_at":"2024-06-26T14:40:58.000Z","dependencies_parsed_at":"2023-02-01T12:31:43.891Z","dependency_job_id":null,"html_url":"https://github.com/mfix22/gest","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfix22%2Fgest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfix22%2Fgest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfix22%2Fgest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfix22%2Fgest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfix22","download_url":"https://codeload.github.com/mfix22/gest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252531972,"owners_count":21763314,"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":["cli","command-line","deployment-testing","gest","graphiql","graphql","graphql-client","integration-testing","jest","regression-testing","test","testing","testing-tools"],"created_at":"2024-08-01T05:01:25.394Z","updated_at":"2025-05-05T16:22:35.390Z","avatar_url":"https://github.com/mfix22.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src='https://raw.githubusercontent.com/mfix22/gest/master/media/logo.png' height='80px' alt='Gest - A sensible GraphQL testing CLI and tool.'\u003e\n\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eA sensible GraphQL testing tool.\u003c/h3\u003e\n\u003cp  align=\"center\"\u003e\n   \u003ca href=\"http://makeapullrequest.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/facebook/jest\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/tested_with-jest-99424f.svg\" alt=\"tested with jest\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/mfix22/gest\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/tested_with-gest-e00098.svg\" alt=\"tested with gest\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/mfix22/gest/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/dawnlabs/carbon.svg\" alt=\"MIT License\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Usage\n\n```bash\n$ npm install -g gest\n```\n\nthen send queries with `gest` (pronounced _guest_ [/ɡest/]).\n\n```bash\n$ gest [options] [query | pathToFileWithQuery]\n```\n\n##### Examples\n\n```bash\n$ gest '{ test }'\n```\n\nor\n\n```bash\n$ gest test.graphql\n\n# with `test.graphql` containing\n{\n  test\n}\n```\n\nor multiple\n\n```bash\n$ gest test.graphql '{ test }' introspection.graphql\n# will run all three queries!\n```\n\n### REPL\n\nIf you run `gest` with no arguments, it will open a REPL for you to run queries in:\n\n```bash\n$ gest\n\nQuery: { test }\n\n{\n  data: {\n    test: \"success!\"\n  }\n}\n```\n\n### HTTP\n\nIf you specify a `baseURL` in your [`config`](#config), `gest` will send an `POST` request with your query correctly encoded in the body. Your `baseURL` must be a valid URL.\n\nYou can specify HTTP headers by using `-H key=value` [flags](#flags).\n\nThis is especially convenient if you are using a [`Now`](https://zeit.co/now) workflow.\n\n##### Example\n\n```bash\n$ gest -H Authorization=e130294e --baseURL https://test-server-2ae34342.now.sh '{ test }'\n```\n\n### Local module\n\nYou can use `gest` as a local module in your unit/integration tests\n\n##### Examples\n\n```javascript\nconst Gest = require('gest')\nconst schema = require('../src/schema')\n\nconst gest = Gest(schema, {\n  baseURL: 'test-server.now.sh',\n  headers: {\n    Authorization: 'Bearer token',\n    Accept: 'application/json'\n  }\n})\n\ndescribe('GraphQL', () =\u003e {\n  test('{ test }', () =\u003e {\n    return gest('{ test }').then(({ data, errors }) =\u003e {\n      expect(errors).toBeUndefined()\n      expect(data).toEqual('success!')\n    })\n  })\n})\n```\n\nor use Global `gest` with [`jest`](https://facebook.github.io/jest/).\n\n```javascript\n// will create global `gest()` function\nGest(schema)\n\n// pass a test name and a query\ngest(\n  'test query',\n  `\n  {\n    test\n  }\n`\n)\n```\n\n**Note**: Global functionality will be turned on by default if `NODE_ENV === test` and if `global.test` or `global.it` exists\n\n## Flags\n\n##### `--all (-A)`\n\nRunning `gest --all` will run all files matching `*.query`, `*.graphql`, or `*.gql` and\nsimply print if each query succeeded without errors\n\n##### `--inspect (-I)`\n\nFor convenience, running `gest --inspect` or `gest -I` will pretty print your GraphQL schema\n\n##### `--print (-P)`\n\nPretty print your GraphQL queries (without using GraphiQL!)\n\n```bash\n$ gest [query | pathToQuery] --print\n```\n\n###### Example\n\n```bash\n$ gest '{test}' --print\n\n{\n  test\n}\n```\n\n##### `--schema (-S)`\n\nYou can specify the path to your GraphQL schema with `gest --schema ./path/to/schema.js`\n\n##### `--baseURL (-B)`\n\nURL to send GraphQL queries to: `gest --baseURL https://test-server.now.sh`\n\n##### `--header (-H)`\n\nHTTP request headers to send with your queries: `gest --header Accept=application/json`.\nHeaders will be passed into context as `context.headers` for every query for local testing.\n\n## Convention\n\nThe `gest` CLI will look to resolve your GraphQL schema in the current working directory for `schema.js`. If you wish to specify a different schema location, do so as `schema` in your [`config`](#config).\n\n## Config\n\nYou can configure the `gest` runtime by adding a `gest` key to your `package.json`, or specifying them as flags.\n\n##### Example\n\n```javascript\n// package.json\n{\n  \"name\": \"your_package\",\n  ...\n  \"gest\": {\n    \"schema\": \"./path/to/schema\",\n    \"baseURL\": \"https://your.url.sh\"\n  }\n}\n```\n\n## Why `gest`?\n\n##### Pros\n\n- :+1: No restarting your dev server when you make changes\n- :+1: Testing your schema doesn't require a separate window (e.g. Graphiql)\n- :+1: Run queries [from files](#usage) (save the queries you use most often)\n- :+1: Simple unit testing for your schema\n- :+1: Easy regression testing with [`gest --all`](#flags).\n- :+1: Simple integration/deployment testing with [`--baseURL`](#http)\n- :+1: Handy introspection and pretty printing\n- :+1: _Helpful_ error messages!\n\n##### Drawbacks\n\n- :-1: No query autocompletion ([yet](https://github.com/mfix22/gest/issues/1))\n\n## Contributing\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it locally\n2. Install the dependencies: `npm install`\n3. Run `npm link` to link the scripts found in `bin` for testing terminal commands\n4. Before submitting a pull request, run `npm test`\n\n## Need help?\n\nRunning `gest help` will show you all the `gest` options. If you have any other concerns, [post an issue!](https://github.com/mfix22/gest/issues)\n\n## Logo\n\nThe official `gest` logo is designed by [`@jakedex`](https://github.com/jakedex)\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/mfix22","https://www.buymeacoffee.com/fix"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfix22%2Fgest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfix22%2Fgest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfix22%2Fgest/lists"}