Update api/resolvers/vault.js

This commit is contained in:
Riccardo Balbo 2024-10-20 09:38:04 +02:00 committed by k00b
parent ed66cfb3f8
commit 6a23aac6f9
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ export default {
*/
function checkOwner (info, ownerType) {
const gqltypeDef = info.schema.getType(ownerType)
const ownerInterfaces = gqltypeDef?.getInterfaces ? gqltypeDef.getInterfaces() : null
const ownerInterfaces = gqltypeDef?.getInterfaces?.()
if (!ownerInterfaces?.some((iface) => iface.name === 'VaultOwner')) {
throw new GqlInputError('owner must implement VaultOwner interface but ' + ownerType + ' does not')
}