You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New to Gatsby I've ran into an issue trying to get categories to work when under a post or as a header link. I'm testing all my queries in GraphiQL but for some reason any time I click on a category wether for the post or at the header it directs me to a 404. Whole issue originated when trying to build a category's page that included pagination. For example, category foo when clicked would use the category template and get all posts for the category foo with pagination if the count was greater than the passed number (which will eventually be an .env variable but is hard coded at the index.js).
I'm stumped on this and have spent days on it reading threw S) posts, docs, and here and even with re-writing and throwing any possible idea at it doesnt seem to work but my noob skills are not there. Any help to get this to work? What am I missing in the connection between the actual link for the category and gatsby-node that makes it go to a 404?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
New to Gatsby I've ran into an issue trying to get categories to work when under a post or as a header link. I'm testing all my queries in GraphiQL but for some reason any time I click on a category wether for the post or at the header it directs me to a 404. Whole issue originated when trying to build a category's page that included pagination. For example, category
foo
when clicked would use the category template and get all posts for the categoryfoo
with pagination if the count was greater than the passed number (which will eventually be an .env variable but is hard coded at the index.js).gatsby-node:
templates/category.js:
Here is the Codesandbox:
and the SO question:
What am I misunderstanding in gatsby-node when trying to build a template page for categories or tags?
I'm stumped on this and have spent days on it reading threw S) posts, docs, and here and even with re-writing and throwing any possible idea at it doesnt seem to work but my noob skills are not there. Any help to get this to work? What am I missing in the connection between the actual link for the category and gatsby-node that makes it go to a 404?
Beta Was this translation helpful? Give feedback.
All reactions