I'm using Gatby-source-prismic for a website. I know this isn't supported anymore but hopefully, the question I have is about implementation rather than a bug:
I have a field in my Prismic page document called 'directory'. If the directory field is filled out then the page is generated in that directory using gatsby-node.
However, I'm having a problem with resolving those pages (prismicLink)
My original gatsby-config had the following:
fetchLinks: ['page.directory'],
lang: process.env.GATSBY_PRISMIC_LANG,
linkResolver: require('./src/utils/linkResolver').linkResolver,
repositoryName: process.env.GATSBY_PRISMIC_MAIN_REPOSITORY_NAME,
customTypesApiToken: process.env.GATSBY_PRISMIC_CUSTOM_TYPES_API_TOKEN,
In my linkResolver I use doc.data.directory
to ensure my links resolve.
Everything was going smoothly until I updated to the latest version of the plugin as it now requires routes: in the configuration, which seems to supersede my linkResolver.
So how can I use directory from my Prismic document in order to resolve my 'routes'?
As a secondary question, I am thinking of updating my fetchLinks to use graphQuery. but everything I try fails. Can you advise/give me an example of how I might use graphQuery in this example?