Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Allow interface type to be used when no fragments #210

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/selections.js
Original file line number Diff line number Diff line change
@@ -141,8 +141,12 @@ export function buildCypherSelection({
// FIXME: this will only handle the first inline fragment
const fragment = fragments[0];

interfaceLabel = fragment.typeCondition.name.value;
const implementationName = fragment.typeCondition.name.value;
interfaceLabel = fragment
? fragment.typeCondition.name.value
: interfaceName;
const implementationName = fragment
? fragment.typeCondition.name.value
: interfaceName;

const schemaType = resolveInfo.schema._implementations[interfaceName].find(
intfc => intfc.name === implementationName