graphql-eslint
graphql-eslint copied to clipboard
Rule to require example and format
I believe there should be a rule to check for an example for each field in types and Inputs. Do you have any plans to add rule for example and format where ever applicable? Please let me know.
type User {
"""
Unique ID of user
example : 1234
"""
id: ID!
"""
Email address of user
example : [email protected]
"""
email: String!
"""
Date when joined
example : 10-10-2020
format : MM-dd-yyyy
"""
joinedDate: Date!
}
For me, this is a perfect example for user's custom rule, you can just copy graphql-eslint’s require-description rule source code and adapt it to your need, via String.includes('example :') call
I don't plan to add this rule to the official codebase