Direct-ID lookup for nodes in graphql fails in some instances
See original GitHub issueDescription
When querying a single node by a direct-ID lookup, the query sometimes returns null. Querying for the whole list, and filtering by something such as slug finds the document fine, with the same ID.
Thanks to @DSchau for helping me debug this.
I had a feeling it was related to https://github.com/gatsbyjs/gatsby/issues/20609, but after testing on a version from before that change (2.18.22), the issue still occurs.
Steps to reproduce
I have no idea how to reliably reproduce this sorry. It has randomly occurred on my project. It appears to just be the one node, on a page with >10k pages (so therefore a lot of nodes are in the db)
This query on the site shows it in a simple way, however.
Expected result
The contentfulBlogPost
query should be able to find a node, as the above query has proven it exists and provided an ID.
Actual result
A direct-ID lookup for this object does not work. Looking up by other things, such as contentful_id, do work.
Environment
System:
OS: macOS 10.15.3
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.14.1 - ~/.npm/bin/node
Yarn: 1.22.0 - ~/.npm/bin/yarn
npm: 6.13.6 - ~/.npm/bin/npm
Languages:
Python: 2.7.17 - /usr/local/bin/python
Browsers:
Firefox: 70.0.1
Safari: 13.0.5
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:24 (19 by maintainers)
So we’ve had this occur again in a way that cannot be worked around.
Using contentful, rich text fields are a separate node, accessed through
content___NODE
. Direct ID lookups are failing for some of these, and therefore thecontent___NODE
field comes up asnull
.I understand this is almost impossible to debug without a minimal reproduction, however I have not been able to create one reliably. The best I can do is using the exact same data so that the node store is in the same state. However this is still not minimal and is very intertwined with systems that can’t easily be shared.
I’m happy to debug and solve this, my main reason for asking again now is to work out if anyone on the Gatsby team has any ideas about what areas of the codebase could cause something like this. I’ve been looking into it for a few days and haven’t been able to find a concrete cause.
Hey again!
It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m
HUMAN_EMOTION_SORRY
. Please feel free to reopen this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!Thanks again for being part of the Gatsby community! 💪💜