Gatsby: Why are there no fields in contentful-source-gatsby DRAFT entries?

Created on 4 Sep 2019  路  3Comments  路  Source: gatsbyjs/gatsby

Summary

I have a articleSeries entry in Contentful, which contains a reference to some articles. I haven't published them all yet, but I linked to the drafts because I wanted to display links for published articles and plain text titles for the draft articles to show what's coming up.

  • [Link] Example Published Article
  • [Text] Example Draft Article
  • etc...

Unfortunately, the draft entries don't have a fields field鈥攋ust sys.

Why is this?

Shouldn't you be able to access fields on draft entries?

awaiting author response question or discussion

All 3 comments

This sounds like you're expecting something from their API but don't get that data back, right? Have you already contacted contenful's support to ask if this data is available through their API? Maybe @Khaledgarbaya can chime in to say if that's a limitation of the source plugin or the API itself 馃憤

Hi @aofolts, draft entries won't show up in the payload that's why you won't see them.
you can use the preview API token to be able to see all the drafts.

Check the docs here on how to use the preview api with the source plugin.

Awesome, thanks @Khaledgarbaya! I haven't used the preview API yet, so I didn't think of that. I'll dive in tomorrow. Appreciate the tip. 馃憦

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  路  3Comments

hobochild picture hobochild  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

magicly picture magicly  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments