Upgrading project to use gatsby-source-prismic and have issues with "fulltext" query in graphQL

Hi!

Am upgrading a project from the "gatsby-source-prismic-graphql" to "gatsby-source-prismic" plugin.

We use the fulltext query in the projects GraphQL queries but since upgrading it doesn't work.

Eg: allPrismicArticle(fulltext: $manufacturer,

Tried many ways to solve and can't find a solution.
Is this expected behaviour of the official plugin?
GitHub page doesn't provide any documentation on this and it seems to be something supported on the prismic API so assume it would be on the official plugin too.

Please advise.

Best,
Dave

Hello David, thanks for reaching out about this. As you've found, it is not possible to use the Fulltext search with the new plugin. You'll need to implement another sort, or filtering method to your queries. Arguments: filter, sort, limit & skip - Prismic. Also, consider using a third-party tool like Algolia to build a search engine on your site

Hi Paulina,
Thanks for your reply.

Yes, I have read the "arguments-filter-sort-limit-skip-gatsby" page and unfortunately it seems quite limited compared to some of the functionality available in the "gatsby-source-prismic-graphql" plugin.

What are the benefits to upgrading to the "gatsby-source-prismic"?

Hi David,

This blog post explains the situation with Gatsby and why we are working with the creator of gatsby-source-plugin in development:

https://prismic.io/blog/gatsby-prismic-plugins

Thanks.

Hi Phil.

Thanks for that article link.
From reading up on this am I right that this upgrade positions us so that with gatsby-source-plugin the preview capability can work.

If so is there a resource that steps through how to set the preview up?
For our existing project we have now upgraded to gatsby-source-plugin.
When hitting the preview button in Prismic and selecting local site takes me to my site at http://localhost:8000/preview?token= but displays 404 page. So something is not right.

Hoping this is something that can be configured to work in this situation?

You're welcome.

Yes, we have documentation on previews with the new Gatsby plugin here:

I'm not sure which one of these relates best to your setup as I'm not really a Gatsby aficionado.

Let me know if anything is unclear and I'll get one of the team in to help out.

Hi Paulina,

We found that using 'regex' worked for us as substitute for fulltext for querying. Would be useful to document this on the "Arguments: filter, sort, limit & skip" page if this is supported for anyone else experiencing similar upgrade issues we did. It got us over the line.

{article_body: {text: {regex: $manufacturerRegex}}

1 Like

We'll make a note of this.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.