happylinks / gqlint

GraphQL (Schema) Linter
MIT License
41 stars 4 forks source link

Check if there are comments/descriptions for the schema #9

Closed happylinks closed 5 years ago

happylinks commented 6 years ago

https://github.com/apollographql/eslint-plugin-graphql/issues/62

stevenqzhang commented 6 years ago

+1 on this one.

The only other schema linter out there has issues parsing the schema first: https://github.com/cjoudrey/graphql-schema-linter/issues/154

happylinks commented 6 years ago

Just to be sure, we're talking about these descriptions right?

type Person {
  """name of a person"""
  name: String
}

I just checked with https://astexplorer.net/#/gist/469297e149939b3fba590438cb630594/ad62349c411d404c2486f73042d71702de733015 and it shouldn't be super hard to make a rule for this.

If you take this one as an example (https://github.com/happylinks/gqlint/blob/master/rules/camelcase.js)

Would you be willing to look into implementing this? If not, also ok, I can try to make some time soon. Let me know!

happylinks commented 6 years ago

Ok I had some time after all 😅

I added two new rules: (https://github.com/happylinks/gqlint/commit/5c5973b684ec760c0cb4f11495226dc5482b5c8a) "description.type": "off", "description.field": "off"

in version 1.7.0

Let me know if this is useful for you!

stevenqzhang commented 6 years ago

Thanks!