Closed tomwilson2 closed 2 years ago
@tomwilson2 Are you using v4?
Yeah, Gatsby4 and Strapi4.
I've been able to replicate this issue from the most basic setup.
To replicate I've just made a new Strapi app.
npx create-strapi-app@latest my-project --quickstart
Made a content-type
; like shoe
, for instance. Changed permissions so it is publically viewable.
Then I made a quick Gatsby app.
npm init gatsby
npm install --save gatsby-source-strapi
Installed and setup the gatsby-source-strapi
plugin.
module.exports = {
siteMetadata: {
title: ``,
siteUrl: `https://www.yourdomain.tld`,
},
plugins: [
{
resolve: `gatsby-source-strapi`,
options: {
apiURL: `http://localhost:1337`,
queryLimit: 1000,
collectionTypes: [{
name: "shoe",
endpoint: "api/shoes",
}]
},
},
],
}
Gatsby version is 4.10.0
. gatsby-source-strapi
is at 1.0.3
. Strapi is at 4.1.5
.
Then I started the Gatsby application and went to ___graphql
where I used this query.
query MyQuery {
allStrapiShoe {
totalCount
pageInfo {
totalCount
}
}
}
But after the query the value is still one. I've had no entries, it shows totalCount
as 1
. I've had four entries, it shows totalCount
as 1
.
I've encountered an issue where
TotalCount
always equals1
.My query at
__graphql
.My plugins configuration at
gatsby-config.js
.