I am trying to grab something from my database using graphql by the items id, and I am not sure how to pass a value into graphql to grab it.
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
const MyCustomComponent = (props) => {
// How do I pass this value
let theValueIWantToPass = 5
// into this query
const data = useStaticQuery(graphql`
query MyQuery {
mongodbItems(id: {eq: "5"}){
id
}
}
`)
return (
<div>
</div>
)
}
export default MyCustomComponent