Gatsby build fails on page generation

Hello!

My build fails with error: GraphQLError: Unknown type "PRISMIC_SortBlog_posty"

Config:

...
{
  resolve: '@prismicio/gatsby-source-prismic-graphql',
  options: {
    repositoryName: process.env.PRISMIC_REPOSITORY_NAME,
    accessToken: process.env.PRISMIC_ACCESS_TOKEN,
    path: '/preview',
    previews: true,
    pages: [{
      type: 'Blog_post',
      match: '/about/blog/:uid',
      path: '/blog-preview',
      component: require.resolve('./src/components/blog-post.tsx')
    }]
  }
}
...

I've noticed that my graphql-types.ts file changed:

export type Prismic_SortBlog_Posty = => export type Prismic_SortBlog_Post =

It looks removing trailing y fixes the issue gatsby-source-prismic-graphql/gatsby-node.ts at master · prismicio/gatsby-source-prismic-graphql · GitHub

Is there any solution for that?

Hi Andrey,

Welcome to the Prismic community, I will try to help with this.
At a first glance, it seems like it is a typo, I will investigate this and get back to you ASAP.

Fares

I’ve been investigating this, it doesn’t seem to be a typo, and I think that the issue can be due to a missing page type “Blog_post” in your custom types or you don’t have instances of this type.

To be able to figure this out, I need the name of your repository, you can send it to me in a private message if confidential.

Looking forward to your reply.

This issue has been closed due to inactivity. Flag to reopen.

Hey @andrey.zhylin,

:rotating_light: I've got an update on the trailing "y".

This isn't an issue with the plugin. There is actually a typo in the API, which sometimes appends a "y" to types in sorting. Both the gatsby-source-prismic and gatsby-source-prismic-graphql plugin developers noted this behavior and accomodated it in their plugins. Last month, a developer noticed the typo and fixed it on one of our clusters. (Prismic repos are spread across nine clusters, and changes are introduced one cluster at a time). Fixing the typo caused some websites on that cluster to break. When users started reporting issues, the change was reverted — that's why some people noticed an issue for a week or two.

We will fix this typo in the future. We will bundle it with a package of other breaking changes in our out-of-beta release for the GraphQL API, which is planned for Q2 2021. We will give everyone plenty of warning before we make that change.

Thanks again for pointing this out and working with us to figure out the source of the issue. Please let me know if you have any questions.

Sam

Re-opened for @andrey.drozd