fetchLinks/GraqhQuery and Routes

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?

@Pau anyone in Prismic able to help here?

I have no idea how to fix this, it's been a while since I don't look at the docs and I just noticed we're not documenting the use of routes in the technical ref. Can we get your help @angeloashmore ?