-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[source-contentful] node deletions bug #5747
Labels
type: bug
An issue or pull request relating to a bug in Gatsby
Comments
Ooooo that's definitely it! I think I added that deleting code early and then later added the id padding code and forgot to update the deleting code. |
Could this be the same bug? #5348 (comment) In that comment, I mentioned there being 1036 nodes, close to 70% were nulls. |
axe312ger
pushed a commit
to axe312ger/gatsby
that referenced
this issue
Jun 6, 2018
Opened a PR which should fix this issue :) |
pieh
pushed a commit
that referenced
this issue
Jun 13, 2018
* fix(contentful): properly delete deleted entries and assets fixes #5747 * remove duplicate id normalization
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you hook up your project with a Contentful space that has deleted blog posts, they are still being fetched by GraphQL. It seems like CF doesn't delete the nodes once they are created--they just get returned with
null
values:The issue this presents is in the index page (src/pages/index.js) because the code is looping through each node and creating a
div
for it (so a user could end up with empty white space on their blog if they have deleted entries--I was able to recreate):I was looking at this issue with another engineer and the easiest solution we could come up with is to only use nodes that have a valid title. So instead of this:
You can filter for only posts that have a title (or any other field):
Question: Is it expected behavior to have phantom nodes even after posts are deleted? And should I create a PR to filter out these nodes if you agree with my assessment?
@zcei Had a theory
The text was updated successfully, but these errors were encountered: