Use for gatsby.js
dimaslanjaka opened this issue · 0 comments
dimaslanjaka commented
Can i using this lib to create graphql for gatsby
const { graphql } = require('gatsby')
If can, can you give me example to use this lib for useStaticQuery
of graphql
with gatsby
?
below codes is gatsby method
import { graphql, useStaticQuery } from "gatsby"
const imagesData = useStaticQuery(graphql`
query {
images: allFile(filter: { sourceInstanceName: { eq: "images" } }) {
edges {
node {
relativePath
absolutePath
name
childImageSharp {
gatsbyImageData
}
}
}
}
}
`)