Running on: Netlify
Using: Node v8.11.3
Gatsby: 1.9.277
In some instances or page queries that ask for all entries of a given Contentful entry type I get duplicate entries. Such a query should have a return:
allContentfulLearnIssue(limit: 5, sort: { fields: [releaseDate], order: DESC }) {
edges{
issue: node {
number
}
}
}
```javascript
allContentfulLearnIssue: {
edges: [
{ issue: { number: 2 } },
{ issue: { number: 3 } },
]
}
Instead I get:
```javascript
allContentfulLearnIssue: {
edges: [
{ issue: { number: 3 } },
{ issue: { number: 2 } },
{ issue: { number: 3 } },
{ issue: { number: 3 } },
{ issue: { number: 2 } }
]
}
The funniest thing about this issue is that it is not reproducible using the Contentful GraphiQL interface, but it is using the Gatsby GraphiQL interface.
How may I help identify what is the potential source of the issue. Do you guys know what is the source file in which I could backtrack this issue?
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.2.0 - /usr/local/bin/npm
Browsers:
Chrome: 67.0.3396.99
Safari: 12.0
npmPackages:
gatsby: ^1.9.166 => 1.9.277
gatsby-link: ^1.6.46 => 1.6.46
gatsby-plugin-postcss-sass: ^1.0.22 => 1.0.22
gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
gatsby-source-contentful: ^1.3.54 => 1.3.54
npmGlobalPackages:
gatsby-cli: 1.1.58
gatsby: 1.9.266
When Contentful pulls the data, all localizations will be pulled. Therefore, if you have a localization active, it will duplicate the entries.
Narrow the search by filtering the query with (filter : { node_locale: { eq: "en-US" }})
This should be in the documentation listed as a caveat.
Hi @tmergulhao, would you like to submit a PR for this documentation update?
Thanks @tmergulhao and @kakadiadarpan! I think this gatsby-source-contentful plugin READme is where the documentation update should happen unless I'm mistaken! https://www.gatsbyjs.org/packages/gatsby-source-contentful/?=gatsby-source
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!
@shannonbux Yeah, that's right. It should go to gatsby-source-contentful plugin's READme.
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
Thanks for being a part of the Gatsby community! 馃挭馃挏
Hey again!
It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
Thanks again for being part of the Gatsby community!