Prefer errors field over client errors

Co-authored-by: Dinah Shi <dinahshi@github.com>
This commit is contained in:
John Hawthorn 2020-07-27 14:17:03 -07:00
Родитель 99ddb80b70
Коммит 25f85e140f
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -60,6 +60,17 @@ module GraphQL
end
end
# It's possible to define "errors" as a field. Ideally this shouldn't
# happen, but if it does we should prefer the field rather than the
# builtin error type.
def errors
if type = @definer.defined_fields["errors"]
read_attribute("errors", type)
else
super()
end
end
private
def verify_collocated_path