Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
fix(json-ld): Get types that implement an interface
Browse files Browse the repository at this point in the history
  • Loading branch information
alastair committed Apr 9, 2021
1 parent 1e669bf commit c375a9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helpers/SchemaHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ 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() })
}

/**
* @param interfaceName
* @returns {*|Array<GraphQLObjectType>}
*/
findInterface (interfaceName) {
return this.schema.getImplementations(interfaceName)
return this.schema.getImplementations({name:interfaceName})
}

/**
Expand Down

0 comments on commit c375a9c

Please sign in to comment.