I have a project structure like so:
-$PROJECT
--src
---data
----projects
-----project1
------project.json
------images
-------project1-preview.png
-----project2
------project.json
-------images
...
And so on, for however many projects. I could query these project.json files when they were named the title of the project and within a projects
folder using allProjectsJson
in graphQl, however now they are within subfolders within projects
. I can only query them individually as allProject1Json and so on. Is there a way to query allProjectsJson so I get all the project.json files?
I can find my projects files by querying allFile
with a filter for json files, however, these files are not transformed json so I can't access the elements.
In my gatsby-config file I am importing src/data as a source for files.