Hi, all, I'm in the process of migrating old GraphQL queries from gatsby-source-prismic-graphql
to gatsby-source-prismic
but it's been extremely difficult to find sufficient information to make the process smooth. Of course, I'm checking the official guides from the plugin as well as from Prismic documentation but they don't cover everything.
So far I have been able to find the "conversion rules" through a few different searches but now I am stuck with one in particular that doesn't seem to be documented anywhere!
My case is:
Old query, works with gatsby-source-prismic-graphql
:
module.exports = `
query loadCategoryCms($lang: String!, $after: String!) {
prismic {
allListers(lang: $lang, after: $after) {
edges {
node {
// suppressed...
_meta {
lang
}
}
}
totalCount
pageInfo {
endCursor
hasNextPage
}
}
}
}
`;
New query, as required by gatsby-source-prismic
, in the point that I got stuck:
module.exports = `
query loadCategoryCms($lang: String!, $after: String!) {
allPrismicLister(filter: {lang: $lang}, after: $after) {
nodes {
lang
data {
// suppressed...
}
}
// haven't implemented totalCount and pageInfo {...} as well
// because I'm not sure where they should go either!!!
}
}
`;
The problem is with the after
argument - when I run the code I get the error: Unknown argument "after" on field "Query.allPrismicLister".
I need this argument because this is part of a pagination logic.
I have not been able to find it anywhere, how the field argument is supposed to be passed in the new query format...
Please help!