Skip to content

Commit

Permalink
Ensure type exists, even after unwrapping
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
leebyron committed Nov 11, 2015
1 parent 8f87bab commit f1f69e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utility/fillLeafs.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ function defaultGetDefaultFieldNames(type) {
// Given a GraphQL type, and a function which produces field names, recursively
// generate a SelectionSet which includes default fields.
function buildSelectionSet(type, getDefaultFieldNames) {
// Unwrap any non-null or list types.
var namedType = getNamedType(type);

// Unknown types and leaf types do not have selection sets.
if (!type || isLeafType(type)) {
return;
}

// Unwrap any non-null or list types.
var namedType = getNamedType(type);

// Get an array of field names to use.
var fieldNames = getDefaultFieldNames(namedType);

Expand Down

0 comments on commit f1f69e8

Please sign in to comment.