Skip to content

Commit 7885655

Browse files
committed
Use index vs existence of parseLiteral fn to check if field is a leaf
1 parent b011146 commit 7885655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/resolvers/parse/ast/literal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const _getTypeFrom_fields = (_fields, path, index = 0) => {
1212
const _field = _fields[name]
1313
const type = _getTypeFrom_fieldOr_arg(_field)
1414

15-
// If type has the parseLiteral function it is a scalar type -> leaf -> end of path
16-
if (type.parseLiteral) return type
15+
// If we are at the end of the path, it is a leaf -> scalar type with parseLiteral function
16+
if (index === path.length) return type
1717

1818
const next = path[index]
1919
// Is the next path element an argument? If yes, follow the argument

0 commit comments

Comments
 (0)