Trying out Prismic with Gatsby. Custom Type with slices - how to query?

I am following all the guides to set up a blog page in combination with slices, but I cant figure out how to query slices? It gives me this error in GraphiQl:


I already pasted the schema of this custom type in a separate folder.

What could it be that I did wrong?

I am using Prismic V3 btw

Ahw, you cant add those fields on Prismic{$contenttype} but I should do these types of queries on AllPrismic{$contenttype}?

Hey @dfmkraaijeveld thanks for reaching out

This error is happening because the union type to get the Slice isn't quite right. If the Slice's name is Text then it should be calling PrismicBlogpostBodyText.

The current documentation is using the plugin's version 4. In this new version, Slice queries follow the same pattern but add the word Data after custom type. So in your case, it would be PrismicBlogpostDataBodyText.

I recommend you read the migration guide from V3 to V4. And let us know if you encounter any issues while migrating:

This thread has been closed due to inactivity. Flag to reopen.