Replies: 1 comment 1 reply
-
You need to pass it in the pageContext and then you will be able to use it in the page queries. Check out https://www.gatsbyjs.com/docs/creating-and-modifying-pages/#pass-context-to-pages |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm coding a gallery, the code is inside a page, i query in graphql my images (that are in subfolder p/) and return them to the page
this basically grab all the image and the print them out formatted, everything works as expected; s
my images are named by their category food_01.jpg, food_02.jpg music_01.jpg and so on (about 10 photos x 4 categories)
At the top of the page i have the category list (its statically typed in, don't need to have it dinamically generated for the moment)
but im struggling to filter the list of images; initiallyi was thinking to pass it to the graphql query (hence i used regex to pass things like food, music and so on) and typing it statically it works, but i cant figure out how to dinamically pass it to the query, i tried something like
but it is not working (even if passing regex as a string inside the query), to be clear, the query is in a page
my second approch was to filter our result once i got them all, but i'm not able to manage the resulting object
i was thinking something like
Any suggestion on how to approach my problem?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions