-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore(gatsby): convert schema-customization to typescript #24259
chore(gatsby): convert schema-customization to typescript #24259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help! But looks like it fails a typecheck now:
packages/gatsby/src/commands/develop-process.ts:202:15 - error TS2322: Type 'IGatsbyState' is not assignable to type '{ schema: GraphQLSchema; schemaCustomization: { composer: SchemaComposer<any>; context: any; }; }'.
The types of 'schemaCustomization.composer' are incompatible between these types.
Type 'SchemaComposer<any> | null' is not assignable to type 'SchemaComposer<any>'.
Type 'null' is not assignable to type 'SchemaComposer<any>'.
202 const {
~
203 schema,
~~~~~~~~~~~~~~~~~
204 schemaCustomization,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205 }: {
~~~~~~~~~
packages/gatsby/src/query/graphql-runner.ts:197:17 - error TS2322: Type 'SchemaComposer<any> | null' is not assignable to type 'SchemaComposer<IGatsbyResolverContext<unknown, unknown>>'.
Type 'null' is not assignable to type 'SchemaComposer<IGatsbyResolverContext<unknown, unknown>>'.
197 schemaComposer: schemaCustomization.composer,
~~~~~~~~~~~~~~
Thank you! I fixed it by using the non-null assertion. |
This reverts commit 849c227.
…atsby-schema-customization
…atsby-schema-customization
…atsby-schema-customization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, let's merge it!
Thank you so much for contributing to our TypeScript refactor! We have more work to do and we would love to have you stay involved in our transition. Please submit more PRs! 💜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, let's merge it!
Thank you so much for contributing to our TypeScript refactor! We have more work to do and we would love to have you stay involved in our transition. Please submit more PRs! 💜
Convert
schema-customization
reducer to TypeScript.Related Issues
#21995