{"repo":"cjoudrey/graphql-schema-linter","free":true,"listed":false,"github":"https://github.com/cjoudrey/graphql-schema-linter","clone":"git clone https://github.com/cjoudrey/graphql-schema-linter.git","description":"Validate GraphQL schema definitions against a set of rules","language":"JavaScript","stars":704,"topics":["graphql","linter"],"license":"MIT","category":"dev-tools","readme_excerpt":"graphql-schema-linter This package provides a command line tool to validate GraphQL schema definitions against a set of rules. If you're looking to lint your GraphQL queries, check out this ESLint plugin: apollographql/eslint-plugin-graphql. Install graphql-schema-linter depends on graphql as a peer dependency. In order to use graphql-schema-linter , you can either add it to an existing project that uses the graphql package: Or, you may install it globally along side graphql : Usage Usage with pre-commit Hooks Using lint-staged and husky, you can lint your staged GraphQL schema file before you commit. First, install these packages: Then add a precommit script and a lint-staged key to your package.json like so: The above configuration assumes that you have either one schema.graphql file or multiple .graphql files that should be concatenated together and linted as a whole. If your project has .graphql query files and .graphql schema files, you'll likely need multiple entries in the lint-staged object - one for queries and one for schema. For example: If you have multiple schemas in the same folder, your lint-staged configuration will need to be more specific, otherwise graphql-schema-linter will assume they are all parts of one schema. For example: Correct: Incorrect (if you have multiple schemas): Configuration file In addition to being able to configure graphql-schema-linter via command line options, it can also be configured via one of the following configuration files. For ","default_branch":null,"files":null,"tree":[],"storefront":"/r/cjoudrey","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cjoudrey/graphql-schema-linter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}