diff options
Diffstat (limited to 'lib/tasks/gitlab/graphql.rake')
-rw-r--r-- | lib/tasks/gitlab/graphql.rake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/graphql.rake b/lib/tasks/gitlab/graphql.rake index ed12b93d311..8a677ff4677 100644 --- a/lib/tasks/gitlab/graphql.rake +++ b/lib/tasks/gitlab/graphql.rake @@ -71,6 +71,12 @@ namespace :gitlab do desc 'GitLab | GraphQL | Validate queries' task validate: [:environment, :enable_feature_flags] do |t, args| + class GenerousTimeoutSchema < GitlabSchema # rubocop:disable Gitlab/NamespacedClass + validate_timeout 1.second + end + + puts "Validating GraphQL queries. Validation timeout set to #{GenerousTimeoutSchema.validate_timeout} second(s)" + queries = if args.to_a.present? args.to_a.flat_map { |path| Gitlab::Graphql::Queries.find(path) } else @@ -78,7 +84,7 @@ namespace :gitlab do end failed = queries.flat_map do |defn| - summary, errs = defn.validate(GitlabSchema) + summary, errs = defn.validate(GenerousTimeoutSchema) case summary when :client_query |