Giter Club home page Giter Club logo

Comments (9)

beve avatar beve commented on August 11, 2024 4

Works great for me. Thank you denisgoryaynov.

Please strapi team, merge ! :)

from gatsby-source-strapi.

denisgoryaynov avatar denisgoryaynov commented on August 11, 2024 3

I opened a pull request to fix this issue #90

from gatsby-source-strapi.

denisgoryaynov avatar denisgoryaynov commented on August 11, 2024 2

Hi, I solved the problem making a fork of this project and changing the code inside src/normalize.js, you should see it in my account. It works and I've been using it on some projects at the company I work, but I still think that the localFile node is an ugly solution but currently that's the best I could come up with and I'm open to other ideas/improvements

from gatsby-source-strapi.

denisgoryaynov avatar denisgoryaynov commented on August 11, 2024 1

Hi, try deleting your cache using rm -rf .cache inside your project. Also the master branch of my fork is missing the build files required for this library to work (I don't want to pollute the main branch). I made a second branch called "build" with these files, so if you are using npm just add #build at the end of the repo url inside your package.json and run npm i to update the files

from gatsby-source-strapi.

Flaex avatar Flaex commented on August 11, 2024

Hi @denisgoryaynov,
I'm developing a personal project using Strapi and Gatsby and I'm getting through this situation. I ended up not using gatsby-image , mapping the array images inside a tag and writing manually the Strapi url of the image, obviously this not a good solution since this will not work on the production environment.

It makes no sense using gatsby-images just for single images and leave array images out because of this. I would like to know where you change your code to be able to create the localFile node, thanks in advance!

from gatsby-source-strapi.

Flaex avatar Flaex commented on August 11, 2024

To be honest, I'm a newbie in programming. This is my first attempt on building a JAMStack web app so I think I will be learning a lot from you and the community. It is very surprising there is no support for multi-images objects on Gatsby since this is a pretty common feature.

It could be not the most elegant solution but is solving a situation that would be a common place for many starters on Gatsby and Strapi. I really appreciate your workaround and your quick response.
Many thanks!

from gatsby-source-strapi.

Flaex avatar Flaex commented on August 11, 2024

Every time I try to gatsby develop after installing your gatsby-source-strapi repo all the Strapi's Content Types are inaccessible by GraphQL. This is the message:

TypeError: Cannot read property 'allStrapiArticle' of undefined

- gatsby-node.js:38 makeRequest.then.result
    e:/wamp/www/@flaex_/app/gatsby-node.js:38:17

gatsby-node.js:38

result.data.allStrapiArticle.edges.forEach(({ node }) => {

Then all the GraphQL request fail e.g.

error GraphQL Error Encountered 11 error(s):                                                                            
- Unknown field 'allStrapiLink' on type 'Query'. Source: document `FooterTemplate` file: `GraphQL request`              
  GraphQL request (3:9)
  2:       query FooterTemplate {
  3:         allStrapiLink {
             ^
  4:           edges {

There is something I'm missing here?

from gatsby-source-strapi.

Flaex avatar Flaex commented on August 11, 2024

Hi @denisgoryaynov. I followed your instructions and now all is working as expected.
When I was searching on the web for alternatives to solve this problem, I found this helper function in the gatsby-source-filesystem plugin. Basically is downloading the file and making available in the GraphQL schema. As far I can see, it is adding more complexity to this situation for non experienced devs like me. I'll sitck with your solution, thanks again for your help!

from gatsby-source-strapi.

aramkoukia avatar aramkoukia commented on August 11, 2024

any updates on this?

from gatsby-source-strapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.