Skip to content

Commit

Permalink
fix(gatsby): Fix sort for Node 12 (#18502)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst authored and GatsbyJS Bot committed Oct 14, 2019
1 parent a1dffac commit d2869ad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/gatsby/src/schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ module.exports.build = async ({ parentSpan }) => {
const typeConflictReporter = new TypeConflictReporter()

// Ensure that user-defined types are processed last
const sortedTypes = types.sort(
type => type.plugin && type.plugin.name === `default-site-plugin`
)
const sortedTypes = [
...types.filter(
type => type.plugin && type.plugin.name !== `default-site-plugin`
),
...types.filter(
type => !type.plugin || type.plugin.name === `default-site-plugin`
),
]

const schemaComposer = createSchemaComposer({ fieldExtensions })
const schema = await buildSchema({
Expand Down

0 comments on commit d2869ad

Please sign in to comment.