Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to enable Strict Mode? #198

Closed
dante-blitz opened this issue Jul 21, 2022 · 1 comment
Closed

Is there a way to enable Strict Mode? #198

dante-blitz opened this issue Jul 21, 2022 · 1 comment

Comments

@dante-blitz
Copy link

dante-blitz commented Jul 21, 2022

Hi there,

I'm recently started working with Gatsby's GraphQL Typegen and types are being generated as expected. However typescript is givieng null error onrequired fields. For example...

Type 'string | null | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.ts(2322)

I've read your Strict Mode announcement post and your Strict Mode docs, but I'm not sure how to enable Strict Mode with this source plugin.

Any guidance is very highly appreciated.

@matjack1
Copy link
Member

@dante-blitz unfortunately the strict mode is for our GraphQL API. Gatsby is using our REST API to fetch data and then exposes it through their internal GraphQL API. So we would need to rewrite the source plugin using our latest JS client that is in Typescript: https://github.com/datocms/js-rest-api-clients

I'm closing this as it's a duplicate of: #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants