gatsby-uc / gatsby-source-strapi

Gatsby source plugin for building websites using Strapi as a data source
MIT License
354 stars 182 forks source link

gatsby-source-strapi Request failed with status code 403 #322

Closed Ayesha1212 closed 2 years ago

Ayesha1212 commented 2 years ago

The routes are publicly are available and working fine while i am using them as a Restful api but graphlq source strapi throwing this error

Here is the error in terminal

"gatsby-source-strapi" threw an error while running the sourceNodes lifecycle:

Request failed with status code 403

Error: Request failed with status code 403

here is my package.json file dependencies.

`"dependencies": {
    "gatsby": "^4.13.0",
    "gatsby-plugin-image": "^2.13.0",
    "gatsby-plugin-react-helmet": "^5.13.0",
    "gatsby-plugin-sharp": "^4.13.0",
    "gatsby-source-filesystem": "^4.13.0",
    "gatsby-source-strapi": "^1.0.3",
    "gatsby-transformer-sharp": "^4.13.0",
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-helmet": "^6.1.0",
    "react-icons": "^4.3.1",
    "react-modern-drawer": "^1.1.1"

},`

TDP17 commented 2 years ago

Make sure your access token has full access, this solved the same issue I had a few days ago image

Also in Users > USERS & PERMISSIONS PLUGIN > Roles > Public check find and findOne options image

remidej commented 2 years ago

As @TDP17 said, please add a full-access API token token to your gatsby-config file.

Having the routes publicly available does not make a difference for this new version of gatsby-source-strapi, we now rely on API tokens instead