{"id":13700853,"url":"https://github.com/urigo/graphql-cli","last_synced_at":"2025-05-13T00:09:29.544Z","repository":{"id":38705935,"uuid":"97463561","full_name":"Urigo/graphql-cli","owner":"Urigo","description":"📟  Command line tool for common GraphQL development workflows","archived":false,"fork":false,"pushed_at":"2025-03-27T06:40:38.000Z","size":6747,"stargazers_count":2012,"open_issues_count":48,"forks_count":115,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-13T00:09:19.650Z","etag":null,"topics":["apollo","cli","graphql","schema","terminal"],"latest_commit_sha":null,"homepage":"https://graphql-cli.com","language":"TypeScript","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/Urigo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-17T10:18:56.000Z","updated_at":"2025-05-12T05:36:03.000Z","dependencies_parsed_at":"2024-05-05T13:48:15.337Z","dependency_job_id":"5227afc2-1a8d-4d1d-8345-2afa7ef57ff3","html_url":"https://github.com/Urigo/graphql-cli","commit_stats":{"total_commits":1807,"total_committers":55,"mean_commits":32.85454545454545,"dds":0.4061981184283343,"last_synced_commit":"aa709566b74a3ee177c54f7dca909c1c4f75a598"},"previous_names":["graphql-cli/graphql-cli","graphcool/graphql-cli"],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urigo%2Fgraphql-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urigo%2Fgraphql-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urigo%2Fgraphql-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urigo%2Fgraphql-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urigo","download_url":"https://codeload.github.com/Urigo/graphql-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843215,"owners_count":21972873,"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":["apollo","cli","graphql","schema","terminal"],"created_at":"2024-08-02T20:01:03.445Z","updated_at":"2025-05-13T00:09:29.508Z","avatar_url":"https://github.com/Urigo.png","language":"TypeScript","readme":"# GraphQL CLI\n\n![image](https://user-images.githubusercontent.com/20847995/67651234-85bf1500-f916-11e9-90e5-cb3bd0e6a338.png)\n\n![CI](https://github.com/Urigo/graphql-cli/workflows/CI/badge.svg)\n[![npm version](http://img.shields.io/npm/v/graphql-cli.svg?style=flat)](https://npmjs.org/package/graphql-cli \"View this project on npm\") [![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://the-guild.dev/discord)\n\nHelp us to improve new GraphQL CLI. Check out the new structure and commands below!\nFeel free to contact us in Discord channel. We would love to hear your feedback.\n\n## Features\n\n- Helpful commands to improve your workflows\n- Compatible with editors and IDEs based on [`graphql-config`](https://github.com/kamilkisiela/graphql-config)\n- Powerful plugin system to extend `graphql-cli` with custom commands\n\n## Install\n\nYou can install the CLI using `yarn` by running the following command. This will add the `graphql` binary to your path.\n\n```sh\nyarn global add graphql-cli\n```\n\nThe equivalent npm global install will also work.\n\n## Migration from 3.x.x to 4.x.x\n\n**Important: many aspects of GraphQL CLI syntax and structure have changed in 4.x.x.** Please check out the [Migration Guide](./docs/MIGRATION.md) to learn more.\n\n## Usage / Initialization\n\nAt the heart of a project created using GraphQL CLI is the GraphQL Config configuration file. For starters, this configuration lets the cd CLI tools know where all of the GraphQL documents and operations are. For more information about GraphQL Config, [you can click here to learn more](https://graphql-config.com/docs/introduction).\n\nThe most straightforward way to launch a GraphQL CLI-capable project with a working GraphQL Config setup is to use the `init` command from your desired workspace:\n\n```sh\nnpx graphql-cli init\n```\n\nAfter a series of questions from the command-prompt, the system will use the inputs and selected project templates to generate a working project complete with a GraphQL Config setup. The GraphQL Config file is generated referencing the necessary files and ecosystem plugins.\n\nYou can also get started with GraphQL CLI by creating your own GraphQL Config file using an editor of your choice. Starting with a filename `.graphqlrc.yml`, for instance, we could add:\n\n```yml\nschema: \"server/src/schema/**/*.graphql\"\ndocuments: \"client/src/documents/**/*.graphql\"\n```\n\nThis is now a valid YAML-syntax GraphQL Config file. Using `init` from the GraphQL CLI will generate a project based on the instructions in your YAML.\n\nFinally, one of the options with `graphql init` is to access schema using an OpenAPI or Swagger endpoint. Choose this option at the start of the Init question tree, and then follow the instructions to navigate to the URL of your choice.\n\n## Plugin System\n\nEach command in GraphQL CLI is a seperate package, so you can have your own plugins or use the ones we maintain. You can have those commands by installing them like `@graphql-cli/[COMMAND-NAME]`.\n\nTo configure a command/plugin, you need to update the `extensions` field in your GraphQL Config file (`.graphqlrc.yml`). See `extensions:` in the example below.\n\n```yml\nschema: \n  ./server/src/schema/**/*.ts:\n    require: ts-node/register\ndocuments: ./client/src/graphql/**/*.ts\nextensions:\n  codegen:\n    generates:\n      ./server/src/generated-types.d.ts:\n        plugins:\n          - typescript\n          - typescript-resolvers\n      ./client/src/generated-types.tsx:\n        plugins:\n          - typescript\n          - typescript-operations\n          - typescript-react-apollo\n      config:\n        withHooks: true\n  graphback:\n    model: './model/*.graphql'\n    plugins:\n      graphback-schema:\n        outputPath: './src/schema/schema.graphql'\n      ...\n```\n  \n [For a detailed example check out a template file here.](https://github.com/Urigo/graphql-cli/blob/master/templates/fullstack/.graphqlrc.yml)\n\nSome of the available Plugins are:\n\n- [`init`](https://github.com/Urigo/graphql-cli/tree/focs/packages/commands/init) - Creates a GraphQL project using a template or GraphQL Config file for your existing project.\n- [`codegen`](https://github.com/dotansimha/graphql-code-generator/tree/master/packages/graphql-cli-codegen-plugin) - GraphQL Code Generator's GraphQL CLI plugin. GraphQL Code Generator is a tool that generates code from your GraphQL schema and documents for your backend or frontend with flexible support for custom plugins and templates. [Learn More](https://graphql-code-generator.com)\n- [`generate`](https://github.com/Urigo/graphql-cli/tree/master/packages/commands/generate) - Generate schema and client-side documents for your GraphQL project by using [Graphback](https://graphback.dev).\n- [`coverage`](https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/coverage) - Schema coverage based on documents. Find out how many times types and fields are used in your application using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/coverage).\n- [`diff`](https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/diff) - Compares schemas and finds breaking or dangerous changes using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/diff).\n    - You can also compare your current schema against a base schema using URL, Git link and local file. You can give this pointer in the command line after `graphql diff` or in GraphQL Config file:\n\n```yml\n# ...\nextensions:\n  diff:\n    baseSchema: git:origin/master:schema.graphql\n```\n\n- [`similar`]((https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/similar)) - Get a list of similar types in order to find duplicates using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/similar).\n- [`validate`]((https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/validate)) - Validates documents against a schema and looks for deprecated usage using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/validate).\n- [`serve`](https://github.com/Urigo/graphql-cli/tree/master/packages/commands/serve) - Serves a GraphQL server, using an in memory database and a defined GraphQL schema. Please read through [serve documentation](./website/docs/command-serve.md) to learn more about this command.\n\nMore plugins are definitely welcome! Please check the existing ones to see how to use GraphQL Config and GraphQL CLI API.\n\n## Contributing\n\nPlease read through the [contributing guidelines](./CONTRIBUTING.md)\n\n## Writing your own plugin\n\nGraphQL CLI supports custom plugins, [you can find a tutorial and example here](./docs/CUSTOM_EXTENSION.md)\n\n## Help \u0026 Community [![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://the-guild.dev/discord)\n\nJoin our [Discord chat](https://the-guild.dev/discord) if you run into issues or have questions. We're excited to welcome you to the community!\n","funding_links":[],"categories":["Implementations"],"sub_categories":["JavaScript/TypeScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furigo%2Fgraphql-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furigo%2Fgraphql-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furigo%2Fgraphql-cli/lists"}