Closed Arsikod closed 5 years ago
https://www.gatsbyjs.org/blog/2019-02-20-introducing-use-static-query/ Limitations: Only one useStaticQuery per Javascript file Is possible
With your 2 queries it is possible: Combine it into one GraphQL query
const data = useStaticQuery(graphql`
query{
allMarkdownRemark{
edges{
node{
fields{
slug
}
frontmatter{
title
date
}
}
}
}
}
`)
I hope I had not make an error ... Check it in graphical explorer
See also the last queries in https://www.gatsbyjs.org/tutorial/part-seven/
Thank you for opening this!
By using only one StaticQuery you should solve your issue.
We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby!
Delete .cache and then gatsby develop again.
Description
Cannot open blog page with useStaticQuery
Steps to reproduce
Expected result
I should see blogPage page
Actual result
Error: The result of this StaticQuery could not be fetched.
This is likely a bug in Gatsby and if refreshing the page does not fix it, please open an issue in https://github.com/gatsbyjs/gatsby/issues
Environment
System: OS: Windows 10 CPU: (2) x64 AMD A9-9420 RADEON R5, 5 COMPUTE CORES 2C+3G Binaries: npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD Languages: Python: 2.7.15 - /c/Users/lenovo/.windows-build-tools/python27/python Browsers: Edge: 42.17134.1.0 npmPackages: gatsby: ^2.15.15 => 2.15.15 gatsby-plugin-playground: ^1.0.6 => 1.0.6 gatsby-plugin-sass: ^2.1.14 => 2.1.14 gatsby-plugin-sharp: ^2.2.24 => 2.2.24 gatsby-remark-images: ^3.1.22 => 3.1.22 gatsby-remark-relative-images: ^0.2.3 => 0.2.3 gatsby-source-filesystem: ^2.1.22 => 2.1.22 gatsby-transformer-remark: ^2.6.23 => 2.6.23