relate-app / gatsby-source-strapi-graphql

A Gatsby source plugin for building websites using Strapi as a data source
BSD Zero Clause License
32 stars 9 forks source link

Missing onError handler for invocation 'building-schema', error was 'Error: Type with name "Time" does not exists'. #19

Closed vinayg-cp closed 2 years ago

vinayg-cp commented 2 years ago

I am trying to integrate this plugin to source my data from strapi. My Strapi details: The collection I am planning to access from gatsby: image

My Plugin config in gatsby: image

But I keep getting the following error: image

My package version: image

When I tried giving the strapi url ending with api: https://v11-tfw-cms-staging.codeparva.com/api

Following was the error: image

Strapi version: 4.0.7

Do we have any example gatsby repo where this plugin has been successfully integrated?

vinayg-cp commented 2 years ago

Never mind, I think Gatsby graphql is not supporting Data Type of time, which the Strapi is supporting. I changed data type from time to string, and everything started working as expected.

PS: We should not append apiURL with '/api', just point it to the base domain. In Collection types, just use whatever you see in your Strapi UI Collections. Example: image

Contributors: Can I close this issue, or do you think you can support the data type of time?

timbrandin commented 2 years ago

Alright, have missed the Time type, we have a mapping to Gatsby types here: https://github.com/relate-app/gatsby-source-strapi/blob/master/helpers.js#L34-L73 most likely we just need to add Time here, though I'm not sure what type it should be converted into to suit all needs.

lightlii commented 2 years ago

Hi, I've noticed this is closed but I'm still having this issue on v4.6.2.