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

Add a GraphQL schema linter, fix found issues #5112

Merged
merged 18 commits into from
Apr 11, 2019

Conversation

aldeed
Copy link
Contributor

@aldeed aldeed commented Apr 10, 2019

Impact: minor
Type: feature

Issue

People often forget or don't know about our conventions for the GraphQL schema files, such as always including field descriptions, alphabetizing fields, and more.

Solution

I've added graphql-schema-linter as a dev dependency, configured it, and defined a few additional custom rules for it.

It found 300+ style issues with the .graphql files, which I've also fixed in this PR. Mostly missing descriptions and fields not alphabetized.

I also added this linting as a CI task.

Breaking changes

None

Testing

  1. Verify you can run the GraphQL linter and there are no issues found: npm run lint:gql
  2. Remove a description from a field, re-run the linter, and verify that is complains about the missing description.
  3. Make sure the API still starts up OK and you can run some GraphQL queries.

Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
for alpha input fields

Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
@aldeed aldeed self-assigned this Apr 10, 2019
@aldeed aldeed requested a review from focusaurus April 10, 2019 18:25
package.json Show resolved Hide resolved
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
@aldeed aldeed requested a review from focusaurus April 10, 2019 22:00
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
Causes errors from Apollo since it was removed from the schema

Signed-off-by: Eric Dobbertin <eric@dairystatedesigns.com>
@aldeed aldeed merged commit 1012362 into develop Apr 11, 2019
@aldeed aldeed deleted the feat-aldeed-graphql-schema-lint branch April 11, 2019 18:12
@jeffcorpuz jeffcorpuz mentioned this pull request Jul 2, 2019
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

Successfully merging this pull request may close these issues.

2 participants