Gatsby: missing printTypeDefinitions for CreateSchemaCustomizationArgs

Created on 21 Oct 2020  路  5Comments  路  Source: gatsbyjs/gatsby

Description

For typescripts, actions in CreateSchemaCustomizationArgs is missing a declaration for printTypeDefinitions

Steps to reproduce

  • Start a brand new typescript gatsby project.
  • Add a function export function createSchemaCustomization({ actions }:): void {} in gatsby-node.ts (or importCreateSchemaCustomizationArgs` in any ts files).
  • note that actions does not have createSchemaCustomization

Expected result

Types for actions.createSchemaCustomization should be present.

Actual result

Types for actions.createSchemaCustomization are missing.

Environment

System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Shell: 5.8 - /usr/local/bin/zsh
Binaries:
Node: 14.13.1 - ~/.nvm/versions/node/v14.13.1/bin/node
npm: 6.14.8 - ~/.nvm/versions/node/v14.13.1/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.80
Firefox: 81.0.2
Safari: 14.0
npmPackages:
gatsby: ^2.24.73 => 2.24.73
gatsby-image: ^2.4.21 => 2.4.21
gatsby-plugin-intl: ^0.3.3 => 0.3.3
gatsby-plugin-manifest: ^2.4.34 => 2.4.34
gatsby-plugin-offline: ^3.2.31 => 3.2.31
gatsby-plugin-react-helmet: ^3.3.14 => 3.3.14
gatsby-plugin-sharp: ^2.6.40 => 2.6.40
gatsby-plugin-styled-components: ^3.3.14 => 3.3.14
gatsby-plugin-ts-config: ^1.1.0 => 1.1.0
gatsby-plugin-typescript: ^2.4.21 => 2.4.21
gatsby-source-contentstack: ^2.2.11 => 2.2.11
gatsby-source-filesystem: ^2.3.34 => 2.3.34
gatsby-transformer-sharp: ^2.5.17 => 2.5.17

Hacktoberfest good first issue TypeScript* bug

All 5 comments

Thanks. This is means that the definition for printTypeDefinitions needs adding to CreateSchemaCustomizationArgs. Helpfully, that function is already typed in packages/gatsby/src/redux/actions/restricted.ts, so it should be a simple fix to copy the definitions from there into gatsby.d.ts

I would like to give this a go

Hey @palaparthi, are you still working on this ? If not then I want to work on this
Thanks :)

Hey @palaparthi, are you still working on this ? If not then I want to work on this
Thanks :)

Sure go ahead

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

andykais picture andykais  路  3Comments

benstr picture benstr  路  3Comments

ferMartz picture ferMartz  路  3Comments