Commit cf1df300 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Add GraphQL lint task with Apollo tooling

parent 1d759e9f
......@@ -119,6 +119,7 @@ overrides:
- '@graphql-eslint'
parserOptions:
parser: '@graphql-eslint/eslint-plugin'
schema: './tmp/tests/graphql/gitlab_schema_apollo.graphql'
operations:
- '{,ee/,jh/}app/**/*.graphql'
# You can run `bundle exec rake gitlab:graphql:schema:dump` and then uncomment this line
......
......@@ -52,12 +52,17 @@ eslint:
- .static-analysis-base
- .yarn-cache
- .static-analysis:rules:ee
needs: []
needs: ['graphql-schema-dump']
variables:
USE_BUNDLE_INSTALL: "false"
script:
- run_timed_command "retry yarn install --frozen-lockfile"
- yarn run apollo client:download-schema --config=config/apollo.config.js tmp/tests/graphql/gitlab_schema_apollo.graphql
- run_timed_command "yarn run lint:eslint:all"
artifacts:
name: graphql-schema-apollo
paths:
- tmp/tests/graphql/gitlab_schema_apollo.graphql
eslint as-if-foss:
extends:
......
module.exports = {
client: {
service: {
name: 'gitlab',
localSchemaFile: './tmp/tests/graphql/gitlab_schema.graphql',
},
includes: ['../{ee/,jh/,}app/assets/javascripts/**/*.{js,graphql}'],
excludes: ['../{ee/,jh/,}spec/{frontend,frontend_integration}/**/*'],
},
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment