6) Learn Gatsby w/ Strapi - Create the Index page view

preview_player
Показать описание
📢 Important Notice: This video uses Strapi v3, the older version of Strapi. We want to ensure you know that Strapi 4 is the latest version with new features, improvements, security patches, and updates.

Please refer to the resources listed below.

This entire video series will take you step by step through creating a blog in Gatsby and teach you how to connect it to the open source headless CMS - Strapi.

Based on the updated June 2019 article (copy/paste code examples from here):

Important links:

Blog Post Read Along Section - for this Video:

All Videos in this tutorial series:

6. Learn Gatsbyjs with Strapi Headless CMS Video Tutorial Series - Create the Index page view - THIS VIDEO
Рекомендации по теме
Комментарии
Автор

I also had the problem with error Cannot query field "childImageSharp" on type "StrapiArticleImage".
This solved the problem for me:
1) Go to Content Type Builder. Change Image media type to single. Click save and wait for the server to restart.
2) On Gatsby side: you may run "Gatsby clean" commend before restarting the server again.

hyperst
Автор

error Cannot query field "childImageSharp" on type "StrapiArticleImage" graphql/template-strings

fungjacky
Автор

I am using MongoDB Atlas, for some reason, it didn't work for me starting from allStrapiArticle :(

Dr_Respawn
Автор

Getting an error like, "error Cannot query field "allStrapiArticle" on type "Query" graphql-template-strings" ???

Check if your version is 3.0 or above by :

gatsby -v

If yes uninstall it using :

npm uninstall -g gatsby-cli

and install v2 using:

sdcvwdcw
Автор

Hi ! I have an issue with the content, the line breaks are not taken care of by the browser.
For exemple, i wrote:

content of post 1
test 1

test 2 test 3

This is the result:
content of post 1 test 1 test 2 test 3

I tried with richtext content types as well, i have the same issue.
I tried also with contentful, same issue

I'm lost, i don't know where is the problem

Thank you

extremtourist
Автор

So how do you exactly preserve the wysiwyg text format from strapi to your view?

eduardstefan
Автор

When querying the API, with the documented queries, I get an html response("unexpected token in json at position ") and when I hit localhost:1337 in the browser it works fine. Why is this happening? Did I set the plugin wrong?

JeSus-hlzj
Автор

Getting an error like, "error Cannot query field "allStrapiArticle" on type "Query" graphql-template-strings" ???

1) check gatsby-config.js and ensure correct contentTypes
2) check Strapi permissions
3) check that articles content exists
4) check the gatsby logs for errors regarding gatsby-source-strapi
5) check the strapi logs for HTTP code 200s (400s bad!)
6) check the gatsby-source-strapi issue tracker on github

insanity
Автор

I am developing news website - there are many news items in different "collection types" How to import data from more than one Collection ?

vankenterprises
Автор

What about markdown in content from strapi? Why it's used childImageSharp, not e.g. image{relativePath} ?

hrabianero
Автор

{"data":null, "error":{"status":404, "name":"NotFoundError", "message":"Not Found", "details":[]}}
what should i do sir

syedmuzzammill
Автор

How is the Strapi data automatically passed in as the data property?
What's with the `edges` property? I don't understand the meaning of it being there, thanks

browsermage
Автор

my eslint show me import { map } from 'lodash';
is not on use.
And why the 3 dots on ...gatsbyImageSharpFixed ? Thanks you

bambanx
Автор

For some reason I can't call authors in GraphQL. In strapi backend authors works ok in article jsone view.

gROszeCK
Автор

I'm not getting the data on Indexpage...shows undefined

alishapanda
Автор

Source
./src/pages/index.js
Syntax error: Unterminated template. (26:33)

24 | export default IndexPage
25 |
> 26 | export const pageQuery = graphql`
| ^
27 | query IndexQuery {
28 | allStrapiArticle {
29 | edges {
This error occurred during the build process and can only be dismissed by fixing the error.

hitmon
Автор

If you having the error of 'Cannot query field "allStrapiArticle" on type "Query"' just check 'findone' permission of the user in the strapi dashboard.

JackBrunsion
Автор

He is hardly audible even on high volume

chaitu