Skip to content

Commit

Permalink
Add comment to clarify the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vladar committed Apr 1, 2020
1 parent bfd4501 commit d843d0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/gatsby/src/schema/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ const group = (source, args, context, info) => {
acc[key] = (acc[key] || []).concat(node)
})
return acc
// Note: using Object.create on purpose:
// object key may be arbitrary string including reserved words (i.e. `constructor`)
// see: https://github.com/gatsbyjs/gatsby/issues/22508
}, Object.create(null))

return Object.keys(groupedResults)
.sort()
.reduce((acc, fieldValue) => {
Expand Down

0 comments on commit d843d0c

Please sign in to comment.