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

Fix Strapi Date & Time types #31

Open ptimson opened 2 years ago

ptimson commented 2 years ago

In my strapi schema I had date & time types:

"attributes": {
    "date": {
      "type": "date",
      "required": true
    },
    "open": {
      "type": "time",
      "required": true
    },
    "close": {
      "type": "time",
      "required": true
    }
  }

Looks like we were only supporting datetime. This fixes the following error:

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

Adding these in to types seems to fix this. Could use String but Date works.