File tree 1 file changed +23
-22
lines changed
packages/gatsby-source-contentful 1 file changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -363,29 +363,30 @@ Rich Text feature is supported in this source plugin, you can use the following
363
363
### Query Rich Text content and references
364
364
365
365
``` graphql
366
- {
367
- allContentfulBlogPost {
368
- edges {
369
- node {
370
- bodyRichText {
371
- raw
372
- references {
373
- ... on ContentfulAsset {
374
- contentful_id
375
- fixed (width : 1600 ) {
376
- width
377
- height
378
- src
379
- srcSet
380
- }
381
- }
382
- ... on ContentfulBlogPost {
383
- contentful_id
384
- title
385
- slug
386
- }
366
+ query pageQuery ($id : String ! ) {
367
+ contentfulBlogPost (id : { eq : $id }) {
368
+ title
369
+ slug
370
+ # This is the rich text field
371
+ bodyRichText {
372
+ raw
373
+ references {
374
+ ... on ContentfulAsset {
375
+ contentful_id
376
+ __typename
377
+ fixed (width : 1600 ) {
378
+ width
379
+ height
380
+ src
381
+ srcSet
387
382
}
388
383
}
384
+ ... on ContentfulBlogPost {
385
+ contentful_id
386
+ __typename
387
+ title
388
+ slug
389
+ }
389
390
}
390
391
}
391
392
}
@@ -420,7 +421,7 @@ const options = {
420
421
},
421
422
}
422
423
423
- function BlogPostTemplate ({ data, pageContext }) {
424
+ function BlogPostTemplate ({ data }) {
424
425
const { bodyRichText } = data .contentfulBlogPost
425
426
426
427
return < div> {bodyRichText && renderRichText (richTextField, options)}< / div>
You can’t perform that action at this time.
0 commit comments