EDIT: now with working code below
I have this query to fetch a gatsby-image:
query getImages($fileName: String) {
la
So to pass variables you have to use following syntax
graphql(``, { indexPage: })
So query will come something like this
export const query = grapqhl(
`query getImages($fileName: String) {
landscape: file(relativePath: {eq: $fileName}) {
childImageSharp {
fluid(maxWidth: 1000) {
base64
tracedSVG
aspectRatio
src
srcSet
srcWebp
srcSetWebp
sizes
originalImg
originalName
}
}
}
}
`,
{fileName: "knight.jpg"}
)