fix(backend): Obfuscate avatar/image fix test

- Then Image.url can be non-nullable because we return null if the
  resource is deleted.
This commit is contained in:
mattwr18 2020-03-23 19:16:10 +01:00
parent e0e026a8b8
commit 698c85b262
4 changed files with 4 additions and 5 deletions

View File

@ -17,10 +17,10 @@ const obfuscate = async (resolve, root, args, context, info) => {
root.contentExcerpt = 'UNAVAILABLE'
root.title = 'UNAVAILABLE'
root.slug = 'UNAVAILABLE'
root.avatar = 'UNAVAILABLE'
root.avatar = null
root.about = 'UNAVAILABLE'
root.name = 'UNAVAILABLE'
root.image = null // avoid unecessary 500 errors
root.image = null
}
return resolve(root, args, context, info)
}

View File

@ -2,7 +2,7 @@ import Resolver from './helpers/Resolver'
export default {
Image: {
...Resolver('Image', {
undefinedToNull: ['sensitive', 'alt', 'aspectRatio', 'url'],
undefinedToNull: ['sensitive', 'alt', 'aspectRatio'],
}),
},
}

View File

@ -1,5 +1,5 @@
type Image {
url: ID,
url: ID!,
# urlW34: String,
# urlW160: String,
# urlW320: String,

View File

@ -201,7 +201,6 @@ type Query {
title: String
slug: String
content: String
image: String
visibility: Visibility
pinned: Boolean
createdAt: String