Giter Club home page Giter Club logo

Comments (5)

clabmb avatar clabmb commented on August 14, 2024 3

I am having this issues as well while following the tutorial: https://blog.strapi.io/building-a-static-website-using-gatsby-and-strapi/

I am also having
error GraphQL Error Unknown field `allStrapiArticle` on type `Query`
38:5 error Cannot query field "allStrapiArticle" on type "Query" graphql/template-strings

success open and validate gatsby-configs — 0.006 s
success load plugins — 0.265 s
success onPreInit — 0.391 s
success delete html and css files from previous builds — 0.019 s
success initialize cache — 0.005 s
success copy gatsby files — 0.018 s
success onPreBootstrap — 0.005 s
⠁ Starting to fetch data from Strapi (articles)
Starting to fetch data from Strapi (users)
error Plugin gatsby-source-strapi returned an error


  Error: connect ECONNREFUSED 127.0.0.1:1337

warning The gatsby-source-strapi plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes — 0.081 s
success building schema — 0.242 s
success createPages — 0.001 s
success createPagesStatefully — 0.038 s
success onPreExtractQueries — 0.003 s
success update schema — 0.108 s
error GraphQL Error Unknown field `allStrapiArticle` on type `Query`

  file: /root/gatsby-strapi-tutorial/blog/src/pages/index.js

   1 |
   2 |   query IndexQuery {
>  3 |     allStrapiArticle {
     |     ^
   4 |       edges {
   5 |         node {
   6 |           id
   7 |           title
   8 |           content
   9 |         }
  10 |       }
  11 |     }
  12 |   }
  13 |

success extract queries from components — 0.127 s
⠁ (node:11534) DeprecationWarning: Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.
success run graphql queries — 0.012 s — 5/5 440.27 queries/second
success write out page data — 0.004 s
success write out redirect data — 0.001 s
⡀ onPostBootstrapdone generating icons for manifest
success onPostBootstrap — 0.220 s

info bootstrap finished - 3.578 s

 ERROR  Failed to compile with 1 errors                                                                                                                                                        10:01:12 PM

 error  in ./src/pages/index.js

Module Error (from ./node_modules/eslint-loader/index.js):

/root/gatsby-strapi-tutorial/blog/src/pages/index.js
  38:5  error  Cannot query field "allStrapiArticle" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)


 @ ./.cache/sync-requires.js 15:50-113
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app

✖ 「wdm」:
ERROR in ./src/pages/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/root/gatsby-strapi-tutorial/blog/src/pages/index.js
  38:5  error  Cannot query field "allStrapiArticle" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./.cache/sync-requires.js 15:50-113
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app
ℹ 「wdm」: Failed to compile.
 WAIT  Compiling...                                                                                                                                                                            10:01:12 PM

ℹ 「wdm」: Compiling...
 ERROR  Failed to compile with 1 errors                                                                                                                                                        10:01:12 PM

 error  in ./src/pages/index.js

Module Error (from ./node_modules/eslint-loader/index.js):

/root/gatsby-strapi-tutorial/blog/src/pages/index.js
  38:5  error  Cannot query field "allStrapiArticle" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)


 @ ./.cache/sync-requires.js 15:50-113
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app

✖ 「wdm」:
ERROR in ./src/pages/index.js
Module Error (from ./node_modules/eslint-loader/index.js):

/root/gatsby-strapi-tutorial/blog/src/pages/index.js
  38:5  error  Cannot query field "allStrapiArticle" on type "Query"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./.cache/sync-requires.js 15:50-113
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app
ℹ 「wdm」: Failed to compile.

from gatsby-source-strapi.

elussich avatar elussich commented on August 14, 2024

Hi @clabmb, the GraphQL error you are getting is most likely due to the initial error that we were mentioning initially, about the Strapi host not being found. Make sure you have a Strapi instance effectively running on 127.0.0.1:1337 and see if the errors persist.

from gatsby-source-strapi.

clabmb avatar clabmb commented on August 14, 2024

Hi @elussich, thanks.... I just fix the problem... I was so stupid that i forgot to start the strapi service....

from gatsby-source-strapi.

lauriejim avatar lauriejim commented on August 14, 2024

Hello @elussich I suggest you to submit a PR if you want this feature.
We don't have time dedicated to work on your point.

from gatsby-source-strapi.

moonmeister avatar moonmeister commented on August 14, 2024

Thanks for your interest in this project. This plugin is moving into the Gatsby User Collective and this repo will be archived. Please open an issue in that repository, submit a PR if you'd like to see this implemented, or join us on Discord if you have questions!

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.