Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule to require example and format #1950

Open
gituserjava opened this issue Oct 19, 2023 · 1 comment
Open

Rule to require example and format #1950

gituserjava opened this issue Oct 19, 2023 · 1 comment

Comments

@gituserjava
Copy link

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!

}

@dimaMachina
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants