I am trying to display a small image in a gatsby app, however, I am not able to figure out the error here.
Code
import React from "react"
import Img from "gatsby-image"
import { graphql } from "gatsby"
const Footer = ({ data }) => (
<div>
<h1>Hello gatsby-image</h1>
<Img fluid={data.footerHeart.file.childImageSharp.fluid} alt="footer" />
</div>
)
export default Footer
export const query = graphql`
query {
footerHeart: file(relativePath: { eq: "love.png" }) {
childImageSharp {
fluid(maxWidth: 40) {
...GatsbyImageSharpFluid
}
}
}
}
`