Variables "$skip" and "$limit" of required type "Int!" were not provided.
Closed this issue · 3 comments
Hi everyone !!!
I'm new on gatsby heheh so maybe I have a dummy mistake,
I don't know what is happening, because in gatsby develop everything is working fine,
but in gatsby build it is not working, so I don't know what else to do,
I tried with rm -r .cache and deleting node modules and reinstalling haha
this is my code :
gatsby-node.js
blog.js
there is something wrong with my query ?
Thanks in advance !!
I suggest posting on stack overflow. We're not able to provide support here.
If you discover a bug in the plugin, will be happy to try and fix.
I also recommend posting an error message, or a very precise definition of what you think is not working on your gatsby build
output.
I'll close this issue now as we don't provide Q&A support here.
Hi @AlmaJaneiro and whoever else may find this. I am not familiar with that plugin, but I think the issue is that you are calling paginate
and createPage
. It looks like paginate
receives the createPage
function and does that for you, so I think when you call createPage
with that template, the query there expects $limit, $skip, etc. to be there via context, but they aren't. Can you try removing the createPage
calls for the BlogPosts
?
An update on the above. In one case I was seeing the createPage
and paginate
using the same component causing this issue. Another case I found was having the component
be in the pages
directory instead of the templates
directory.
Wrong:
paginate({
createPage,
items: blogPosts,
itemsPerPage: 3,
pathPrefix: "/blogs",
// Note /pages/ here
component: path.resolve(`./src/pages/blogs.js`),
})
Correct:
paginate({
createPage,
items: blogPosts,
itemsPerPage: 3,
pathPrefix: "/blogs",
// Note /templates/ here
component: path.resolve(`./src/templates/blogs.js`),
})
The issue is that if the component
is under pages
then the query will attempt to run without the required context.