allFile query :
query{
allFile{
edges{
node{
childMarkdownRemark{
frontmatter{
title
desc
link
}
}
childImageSharp{
fluid{
srcSetWebp
}
}
}
}
}
}
For the above allFile query i get the below output
{
"data": {
"allFile": {
"edges": [
{
"node": {
"childMarkdownRemark": {
"frontmatter": {
"title": "Arrays in Javascript ",
"desc": "I am hello i am the greatest lorem ipsum diut shit in the world of world",
"link": null
}
},
"childImageSharp": null
}
},
}
allMarkdown query:
query{
allMarkdownRemark{
edges{
node{
frontmatter{
title
desc
link
}
}
}
}
}
The output for the above allMarkdown query is
{
"data": {
"allMarkdownRemark": {
"edges": [
{
"node": {
"frontmatter": {
"title": "This is party react",
"desc": "I am React GUyyyy ",
"link": null
}
}
},
The output is limited to 1 item to save space for the question
Is there any performance difference between allFile and allMarkdownRemark query
In allFile query, we can fetch relative path, relative Directory whereas allMarkdownRemark is limited to fileAbsolutePath
We have access to markdown in allFile query using childMarkdownRemark as you can see above.
In many YouTube tutorials, people use allMarkdownRemark. Is there any specific reason to do so?