[GraphQL] expose file information

This commit is contained in:
Paul Chavard 2019-12-11 12:24:50 +01:00
parent 1146447c14
commit 422b7f37ec
9 changed files with 59 additions and 19 deletions

View file

@ -28,9 +28,9 @@ module Extensions
# This method is called if the result of the `resolve`
# is a lazy value (e.g., a Promise like in our case)
def after_resolve(value:, **_rest)
return if value.nil?
Rails.application.routes.url_helpers.url_for(value)
if value&.virus_scanner&.safe? || value&.virus_scanner&.pending?
value
end
end
end
end