diff --git a/e2e-tests/contentful/package.json b/e2e-tests/contentful/package.json index 335b2daad0e2a..79cc030e54cd8 100644 --- a/e2e-tests/contentful/package.json +++ b/e2e-tests/contentful/package.json @@ -6,7 +6,6 @@ "dependencies": { "@contentful/rich-text-types": "^14.1.2", "gatsby": "next", - "gatsby-image": "next", "gatsby-plugin-image": "next", "gatsby-plugin-sharp": "next", "gatsby-source-contentful": "next", @@ -34,6 +33,7 @@ ], "license": "MIT", "scripts": { + "clean": "gatsby clean", "build": "gatsby build", "develop": "gatsby develop", "format": "prettier --write '**/*.js'", diff --git a/packages/gatsby-source-contentful/src/extend-node-type.js b/packages/gatsby-source-contentful/src/extend-node-type.js index 41a1de3064d48..2acfc6a835462 100644 --- a/packages/gatsby-source-contentful/src/extend-node-type.js +++ b/packages/gatsby-source-contentful/src/extend-node-type.js @@ -1,6 +1,7 @@ // @ts-check import { stripIndent } from "common-tags" -import { GraphQLBoolean, GraphQLInt, GraphQLJSON } from "gatsby/graphql" +import { GraphQLBoolean, GraphQLInt } from "gatsby/graphql" +import { hasFeature } from "gatsby-plugin-utils" import { resolveGatsbyImageData } from "./gatsby-plugin-image" import { ImageCropFocusType, ImageResizingBehavior } from "./schemes" @@ -42,7 +43,9 @@ export async function setFieldsOnGraphQLNodeType({ type, cache }) { } ) - fieldConfig.type = GraphQLJSON + fieldConfig.type = hasFeature(`graphql-typegen`) + ? `GatsbyImageData` + : `JSON` return fieldConfig }