Closed Linny3D closed 2 years ago
You should check your config, the error is a bit unclear here, but I had this when I used wrong collection type names. (check the plural / singular variants and make sure permissions are open)
Thanks you were right. Didn't notice that i had to use
apiURL: 'http://localhost:1337',
instead of
apiURL: 'http://localhost:1337/api/',
I already tried that before, but i thought it would not work, because then i get another strange error:
ERROR
UploadFileQuery failed – Forbidden access
===== QUERY =====
query UploadFileQuery($pagination: PaginationArg, $updatedAt: DateTime) {
uploadFiles(pagination: $pagination, filters: {updatedAt: {gt: $updatedAt}}) {
__typename
data {
__typename
id
attributes {
__typename
name
alternativeText
caption
width
height
formats
hash
ext
mime
size
url
previewUrl
provider
provider_metadata
createdAt
updatedAt
}
}
meta {
pagination {
total
}
}
}
}
===== VARIABLES =====
{
"pagination": {
"start": 0,
"limit": 1000
},
"updatedAt": "1990-01-01T00:00:00.000Z"
}
===== ERROR =====
Forbidden access
Although this error occurs during startup, my queries are working now. I don't know where this error comes from though. It even occurs with a fresh Gatsby app.
I guess i still have a lot to learn about Gatsby an Strapi ;)
For the other error to go away you have to set the find/findOne permissions open for Upload for public access in Strapi, guess it is necessary for media file downloads.
I'm facing the same issue and have currently no idea how to solve it. Simple Gatsby-Starter with Strapi 4.0.5 with one Collection Type:
API ID (Singular): job API ID (Plural): jobs
Permissions: find and findOne
Api Token: Read-only
{
resolve: 'gatsby-source-strapi',
options: {
apiURL: 'http://localhost:1337',
collectionTypes: ['jobs'],
locale: 'de', // default to all
headers: {},
token:
'29ab2473e23a57dc3a42b56af422de14b7c95b94c31566345ddea34f695c6fc2885f02269962b9287f8457246820d00192c6c2574606c3debc97cfa3f827b6e05a5d17c18211f691ee26ca67d8e229478270d45021016d22e65847b0dea806f676da388fa0fd46b63267f492215238a2d58db8fe4585bce443c250d2bf96fedf',
},
},
I was able to resolve this issue by:
graphql
plugin on Strapi
gatsby-config.js
{
resolve: `gatsby-source-strapi`,
options: {
apiURL: `http://127.0.0.1:1337`,
queryLimit: 50,
collectionTypes: [`page`, `category`],
}
}
Hi, I just tried your plugin with almost bare skeleton Scrapi and Gatsby apps. If i start the development server, the following error occurs, during the build process (createSchemaCustomization lifecycle).
This is, what my Plugin Config looks like:
I am using the latest 4.2.1 version of your plugin, using npm 8.1.2. I don't know if it is a problem with the plugin or if i'm making a mistake here, because i'm quite new to Gatsby.
Best Regards Linny