Skip to content

Commit

Permalink
feat(gatsby-transformer-sharp): expose sizes argument for fluid query (
Browse files Browse the repository at this point in the history
…#8466)

* Expose sizes

* Allow querying presentationWidth
  • Loading branch information
stefanprobst authored and pieh committed Sep 24, 2018
1 parent bb5c0d2 commit efe95a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/gatsby-transformer-sharp/src/extend-node-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ const fluidNodeType = ({
sizes: { type: GraphQLString },
originalImg: { type: GraphQLString },
originalName: { type: GraphQLString },
presentationWidth: { type: GraphQLInt },
presentationHeight: { type: GraphQLInt },
},
}),
args: {
Expand Down Expand Up @@ -257,6 +259,10 @@ const fluidNodeType = ({
type: GraphQLInt,
defaultValue: 0,
},
sizes: {
type: GraphQLString,
defaultValue: ``,
},
},
resolve: (image, fieldArgs, context) => {
const file = getNodeAndSavePathDependency(image.parent, context.path)
Expand Down

0 comments on commit efe95a4

Please sign in to comment.