I need to access { excerpt, title, author, category, slug, readTime, image } those data from the query, I have tried many time, but I can't think how to do.
my code is:
import React from 'react'
import PropTypes from 'prop-types'
import { Helmet } from 'react-helmet'
import { useStaticQuery, graphql } from 'gatsby'
const SEO = () => {
return <div>SEO Component</div>
}
export const query = graphql`
{
allMdx(limit: 3, sort: { fields: frontmatter___date, order: DESC }) {
nodes {
excerpt
frontmatter {
title
author
category
date(formatString: "MMMM, Do YYYY")
slug
readTime
image {
childImageSharp {
gatsbyImageData
}
}
}
id
}
}
}
`
export default SEO
after that I want like this
const SEO = ({ excerpt, title, author, category, slug, readTime, image }) => {
return <div>SEO Component</div>
}
Then I will access those data inside my SEO component.
I'm new in graphQL
Thank you.
const SEO = ({ excerpt, title, author, category, slug, readTime, image }) => { return <div>SEO Component</div> }SEOcomponent.