Skip to content

Commit

Permalink
chore(gatsby-source-contentful): Remove deprecated image resolvers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Feb 10, 2021
1 parent 0927cb0 commit e691342
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 115 deletions.
10 changes: 0 additions & 10 deletions packages/gatsby-source-contentful/src/extend-node-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,17 +738,9 @@ exports.extendNodeType = ({ type, store, reporter }) => {
return imageProps
}

// TODO: Remove resolutionsNode and sizesNode for Gatsby v3
const fixedNode = fixedNodeType({ name: `ContentfulFixed`, getTracedSVG })
const resolutionsNode = fixedNodeType({
name: `ContentfulResolutions`,
getTracedSVG,
})
resolutionsNode.deprecationReason = `Resolutions was deprecated in Gatsby v2. It's been renamed to "fixed" https://example.com/write-docs-and-fix-this-example-link`

const fluidNode = fluidNodeType({ name: `ContentfulFluid`, getTracedSVG })
const sizesNode = fluidNodeType({ name: `ContentfulSizes`, getTracedSVG })
sizesNode.deprecationReason = `Sizes was deprecated in Gatsby v2. It's been renamed to "fluid" https://example.com/write-docs-and-fix-this-example-link`

// gatsby-plugin-image
const getGatsbyImageData = () => {
Expand Down Expand Up @@ -783,9 +775,7 @@ exports.extendNodeType = ({ type, store, reporter }) => {

return {
fixed: fixedNode,
resolutions: resolutionsNode,
fluid: fluidNode,
sizes: sizesNode,
gatsbyImageData: getGatsbyImageData(),
resize: {
type: new GraphQLObjectType({
Expand Down
105 changes: 0 additions & 105 deletions packages/gatsby-source-contentful/src/fragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,108 +155,3 @@ export const contentfulAssetFluidPreferWebpNoBase64 = graphql`
sizes
}
`

// TODO: in v3 remove these legacy fragments
export const GatsbyContentfulResolutions = graphql`
fragment GatsbyContentfulResolutions on ContentfulResolutions {
base64
width
height
src
srcSet
}
`

export const GatsbyContentfulResolutions_tracedSVG = graphql`
fragment GatsbyContentfulResolutions_tracedSVG on ContentfulResolutions {
tracedSVG
width
height
src
srcSet
}
`

export const GatsbyContentfulResolutions_noBase64 = graphql`
fragment GatsbyContentfulResolutions_noBase64 on ContentfulResolutions {
width
height
src
srcSet
}
`

export const GatsbyContentfulResolutions_withWebp = graphql`
fragment GatsbyContentfulResolutions_withWebp on ContentfulResolutions {
base64
width
height
src
srcSet
srcWebp
srcSetWebp
}
`

export const GatsbyContentfulResolutions_withWebp_noBase64 = graphql`
fragment GatsbyContentfulResolutions_withWebp_noBase64 on ContentfulResolutions {
width
height
src
srcSet
srcWebp
srcSetWebp
}
`

export const GatsbyContentfulSizes = graphql`
fragment GatsbyContentfulSizes on ContentfulSizes {
base64
aspectRatio
src
srcSet
sizes
}
`

export const GatsbyContentfulSizes_tracedSVG = graphql`
fragment GatsbyContentfulSizes_tracedSVG on ContentfulSizes {
tracedSVG
aspectRatio
src
srcSet
sizes
}
`

export const GatsbyContentfulSizes_noBase64 = graphql`
fragment GatsbyContentfulSizes_noBase64 on ContentfulSizes {
aspectRatio
src
srcSet
sizes
}
`

export const GatsbyContentfulSizes_withWebp = graphql`
fragment GatsbyContentfulSizes_withWebp on ContentfulSizes {
base64
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
`

export const GatsbyContentfulSizes_withWebp_noBase64 = graphql`
fragment GatsbyContentfulSizes_withWebp_noBase64 on ContentfulSizes {
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
}
`

0 comments on commit e691342

Please sign in to comment.