diff --git a/packages/gatsby-source-contentful/src/create-schema-customization.ts b/packages/gatsby-source-contentful/src/create-schema-customization.ts index e0f9602136fd9..0ace98a95372d 100644 --- a/packages/gatsby-source-contentful/src/create-schema-customization.ts +++ b/packages/gatsby-source-contentful/src/create-schema-customization.ts @@ -579,11 +579,13 @@ export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"] const res = await context.nodeModel.findAll({ query: { - sys: { - id: { - in: links, + filter: { + sys: { + id: { + in: links, + }, + spaceId: { eq: node.sys.spaceId }, }, - spaceId: { eq: node.sys.spaceId }, }, }, type: `Contentful${entityType}`,