eslint-plugin-graphql-descriptions

0.0.2 • Public • Published

Politely asks about adding descriptions in GraphQL

Installation

You'll first need to install ESLint:

$ yard add dev eslint

Next, install eslint-plugin-graphql-descriptions:

$ yarn add dev eslint-plugin-graphql-descriptions

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-graphql-descriptions globally.

Usage

Add graphql-descriptions to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "graphql-descriptions"
    ]
}

Supported Rules

  • Ensure that all GraphQLObjectType objects have a description field.
// Fails
const BidderType = new GraphQLObjectType({
  name: 'Bidder',
  fields: () => ({}),
});
 
// Passes
const BidderType = new GraphQLObjectType({
  name: 'Bidder',
  description: 'A user with bids'
  fields: () => ({}),
});

Package Sidebar

Install

npm i eslint-plugin-graphql-descriptions

Weekly Downloads

1

Version

0.0.2

License

ISC

Last publish

Collaborators

  • orta