Skip to content

Commit

Permalink
Use index vs existence of parseLiteral fn to check if field is a leaf
Browse files Browse the repository at this point in the history
  • Loading branch information
schwma committed Mar 4, 2024
1 parent b011146 commit 7885655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resolvers/parse/ast/literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const _getTypeFrom_fields = (_fields, path, index = 0) => {
const _field = _fields[name]
const type = _getTypeFrom_fieldOr_arg(_field)

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

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

0 comments on commit 7885655

Please sign in to comment.