Today we noticed that one of our repos will not build locally or on Netlify. We're using the gatsby-source-prismic-graphql plugin. We've made no code changes and the site was building fine yesterday. Here's the error I'm seeing when running gatsby develop:
"@prismicio/gatsby-source-prismic-graphql" threw an error while running the createPages lifecycle:
Unknown type "PRISMIC_SortPagey". Did you mean "PRISMIC_SortPage", "PRISMIC_Page", "PRISMIC_WherePage", "PRISMIC_SortFooter", or "PRISMIC_Footer"?
260 | });
261 | _context.next = 10;
> 262 | return graphql(query, {
| ^
263 | after: endCursor,
264 | lang: lang || null,
265 | sortBy: page.sortBy
File: node_modules/gatsby-source-prismic-graphql/gatsby-node.js:262:32
Error: Unknown type "PRISMIC_SortPagey". Did you mean "PRISMIC_SortPage", "PRISMIC_Page", "PRISMIC_WherePage", "PRISMIC_SortFooter", or "PRISMIC_Footer"?
GraphQL request:2:64
1 |
2 | query AllPagesQuery ($after: String, $lang: String, $sortBy: PRISMIC_SortPagey) {
| ^
3 | prismic {
- graphql-runner.ts:98 GraphQLRunner.validate
[ecopoxy]/[gatsby]/src/query/graphql-runner.ts:98:22
- graphql-runner.ts:162 GraphQLRunner.query
[ecopoxy]/[gatsby]/src/query/graphql-runner.ts:162:25
- create-graphql-runner.ts:59
[ecopoxy]/[gatsby]/src/bootstrap/create-graphql-runner.ts:59:8
- gatsby-node.js:262 _callee$
[ecopoxy]/[gatsby-source-prismic-graphql]/gatsby-node.js:262:32
At first I posted the issue on github thinking it was related to the plugin, but after digging into my repos schema types I noticed that they have mysteriously changed over night.
When I run this query:
query{
__schema{
types{
name
}
}
}
Here's that i see:
...
{
"name": "SortPage"
},
...
But on my other repos which are building correctly I see the following (notice the appended "y"):
{
"name": "SortPagey"
},
I'm not aware of any changes we made to this repo, so not sure about the discrepancy.
Thanks for posting and including plenty of detail.
I'm going to check in with our development team to see if they have any ideas about what could be causing the issue. Could you let me know the name of the repo with the problem? (You can DM it if you don't want to share it publicly.)
So it looks like the graphql api changed again back to 'SortPagey'. Not sure what's going on. Would someone from Prismic be able to chime in about what has changed or if there's something I need to be aware of?
There is indeed a typo in the GraphQL 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 accommodated 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
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
14
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.