gatsby-source-strapi | Gatsby source plugin for building websites using Strapi | REST library
kandi X-RAY | gatsby-source-strapi Summary
kandi X-RAY | gatsby-source-strapi Summary
Source plugin for pulling documents into Gatsby from a Strapi API. ️ This version of gatsby-source-strapi is only compatible with Strapi v4. For v3 use this release.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-source-strapi
gatsby-source-strapi Key Features
gatsby-source-strapi Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-source-strapi
QUESTION
Category of Post created by Strapi cannot be retrieved by GraphQL of Gatsby.js. However, it is displayed in GraphiQL of Gatsby.js.
I can call and display all but categories.
I am calling it as follows.
{categories.name}、{category.slug} I can't get these.
gatsby-config.js
...ANSWER
Answered 2022-Jan-18 at 06:09If you are able to see the categories in GraphiQL and not display them, your issue is in the view and how are you treating the data. In this case, (after the typical editions), categories
is an array as posts
are so unless you loop through them, you won't be able to display them.
Do something like:
QUESTION
I have run gatsby clean
before npm run develop
but still it has not made a difference...
My gatsby-node.js file has been looked at by others who are familiar with the Gatsby framework, and they're not sure what the problem is either...
Here is my gatsby-node.js file:
...ANSWER
Answered 2021-Sep-30 at 07:58Try running gatsby clean first, and then try it again…
QUESTION
I need to get a query using graphql in strapi/gatsby where id is {id}. According to the documentation found here you query all like so:
...ANSWER
Answered 2021-Jun-22 at 06:09Use:
QUESTION
This query
...ANSWER
Answered 2021-Jun-01 at 05:42So my issue is that I do not know how a user can download all the images by clicking on a link.
Given that scenario, I would recommend avoiding the Link
component, since doesn't fit your requirements.
I would do something like:
QUESTION
I have a gatsby portfolio application and had to do some updates to it. Then cloned it from github and had to install dependencies. When i run npm install
i have the error log below:
ANSWER
Answered 2021-May-10 at 08:25This is not a problem from your side. It is not a problem of package.json
. In the ERR
, the URL https://registry.npmjs.org/axios
(last line of the error message) gives a JSON response which is flawed. See the below image. The JSON validation fails. They must resolve this.
Try running
QUESTION
I have been following these steps: https://github.com/strapi/gatsby-source-strapi Since image >> publicURL also didn't work, I have reinstalled the newest version gatsby-source-strapi, in order to be able to get publicURL. This goes throug a local file though...
Here is my gatsby-config.js
...ANSWER
Answered 2021-Apr-27 at 07:26According to:
The page won't display in dev: Error: Cannot read property 'publicURL' of undefined.
images
is an array so it needs to be accessed as:
Have you tried?
QUESTION
Trying to deploy my Gatsby app on netlify. Basically, I added some jQuery for some specific purposes but when I uploaded it, I got the ff error:
...ANSWER
Answered 2021-Jan-19 at 07:34As I was saying, it's not Netlify's fault since the project is not building locally. You should ensure always that your project is correctly coded in both environments (build and develop) since they have substantial differences between them. A project that works under gatsby develop
doesn't mean that it's perfectly coded, only means that it work under certain conditions. You can check the overview between runtime and build-time in Gatsby's docs, the main difference relies on gatsby build
's Gatsby Server-Side Rendering (SSR). Keep in mind that you are using jQuery, which points directly to the real DOM, having a high-performance impact on the site, while React, creates and manipulates a virtual DOM (vDOM) to avoid that kind of high-cost actions. It's odd using both approaches.
In addition, you are importing everything in the component, which will be used across your project in multiple components/pages. This may lead to multiple script rendering/loading if the component is rerendered.
Said that, your issue may be caused by:
AOS.init();
- The script importation: since they aren't promises, they will be imported at the same time. If for some reason one of them is loaded first (the lighter) and it's dependant on the other one, it will break your project, since it won't be able to load. You are not loading jQuery, unless it's in
scripts.js
.
You have many approaches, from changing the approach and using a React-based one, to try to async
the script importation (and loading jQuery before), but all the workarounds will need to be tested with some trials and errors:
QUESTION
Just in case, I'd like to know against Gatsby app, in case its settings differ from other node based apps.
I want to refactor gatsby-config.js
by moving http://localhost:1337
to .env
.
From
...ANSWER
Answered 2020-Nov-17 at 06:16Create a file in the root of your project named .env.development
and .env.production
. There, create your variable, just:
QUESTION
I'm using this Gatsby starter : https://www.gatsbyjs.org/starters/Vagr9K/gatsby-material-starter as I was looking for something to introduce myself both to Gatsby and to Material UI.
My first objective was to change Netlify CMS for Strapi CMS, I've followed these steps:
- Removed Netlify plugin, both from gatsby-config.js, package.json and make uninstall.
- Added Strapi to the project:
- npm install --save gatsby-source-strapi and add the plugin to gatsby-config.js
Here's how I added the Strapi plugin to gatsby-config.js:
And here's the error I'm getting:
I think it might be related to Gatsby not being able to contact the remote Strapi server, any idea on how to solve this?
...ANSWER
Answered 2020-Apr-07 at 10:55Okey, so this was a dumb mistake that I just couldn't see: after trying different solutions, which didn't work, I realized that Strapi was trying to fetch data from http://167.172.32.171//posts?_limit=1000, so my problem was that I had an extra / in the URL I indicated to the plugin.
QUESTION
I am building a web app with Gatsby and are having trouble figuring out how to fetch data from the deployed Strapi-app. Gatsby is deployed to Netlify, Strapi deployed to Heroku. (I have no trouble fetching data when running both projects locally)
I appreciate all the help and useful advice!
EDIT: Found one solution to this problem. In gatsby-config.js -> gatsby-source-strapi; set apiURL = "process.env.API_URL || 'http://localhost:1337'", and made a new file called ".env.development" in the root folder and typed in "API_URL='your-heroku-app'"
I am sure there exist a similar solution to use when it is not in development-mode.
...ANSWER
Answered 2020-Mar-13 at 14:56We explain how to deploy both Strapi on Heroku and Gatsby on Netlify in this tutorial: https://strapi.io/blog/building-a-static-website-using-gatsby-and-strapi#11deploygatsbytonetlify
I hope it will provide the answer to your question :)
Cheers!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-source-strapi
To enable content sync in Gatsby cloud you need to create two webhooks in your Strapi project:. At this point each time you create an entry the webhooks will trigger a new build a deploy your new Gatsby site.
Build webhook
Preview webhook
Build variables with the following: STRAPI_API_URL with the url of your deployed Strapi application STRAPI_TOKEN with your build API token
Preview variables: STRAPI_API_URL with the url of your deployed Strapi application STRAPI_TOKEN with your preview API token
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page