Skip to content

Commit

Permalink
fix: update testing/schema_structure.md
Browse files Browse the repository at this point in the history
The validate method returns array.
  • Loading branch information
JohnnyKei committed Mar 16, 2024
1 parent 4315fb1 commit 59a3307
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions guides/testing/schema_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ namespace :graphql do
puts "\n"

results = queries.map { |query| schema.validate(query) }
errors = results
.select { |result| result[:errors].present? }
.map { |result| result[:errors] }
.flatten
errors = results.flatten

if errors.empty?
puts '✅ All queries are valid'
Expand Down

0 comments on commit 59a3307

Please sign in to comment.