From c375a9c50d2c19ba551876ba4bf5a62626d0e71d Mon Sep 17 00:00:00 2001 From: Alastair Porter Date: Fri, 9 Apr 2021 11:36:59 +0200 Subject: [PATCH] fix(json-ld): Get types that implement an interface --- src/helpers/SchemaHelper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/SchemaHelper.js b/src/helpers/SchemaHelper.js index 2cfb675..8ae1638 100644 --- a/src/helpers/SchemaHelper.js +++ b/src/helpers/SchemaHelper.js @@ -31,11 +31,11 @@ class SchemaHelper { */ findInterfaceImplementingTypes (interfaceName) { const implementations = this.findInterface(interfaceName) - if (!Array.isArray(implementations) || !implementations.length) { + if (!implementations.objects || !Array.isArray(implementations.objects) || !implementations.objects.length) { return null } - return implementations.map(implementation => { return implementation.toString() }) + return implementations.objects.map(implementation => { return implementation.toString() }) } /** @@ -43,7 +43,7 @@ class SchemaHelper { * @returns {*|Array} */ findInterface (interfaceName) { - return this.schema.getImplementations(interfaceName) + return this.schema.getImplementations({name:interfaceName}) } /**