-
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): Migrate types/node-interface.js to TypeScript #26733
Conversation
Hi folks. |
Hello, is anyone there? |
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 suggesting this 👍
In general it looks good to me but there are two incorrect types which I mention in inline comments. Fix those and we are good to go!
@@ -28,7 +37,7 @@ const getOrCreateNodeInterface = schemaComposer => { | |||
id: `ID!`, | |||
parent: { | |||
type: `Node`, | |||
resolve: (source, args, context, info) => { | |||
resolve: (source, _args, context): Node => { |
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.
resolve: (source, _args, context): Node => { | |
resolve: (source, _args, context): Node | null => { |
@@ -40,7 +49,7 @@ const getOrCreateNodeInterface = schemaComposer => { | |||
}, | |||
children: { | |||
type: `[Node!]!`, | |||
resolve: (source, args, context, info) => { | |||
resolve: (source, _args, context): Node => { |
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.
resolve: (source, _args, context): Node => { | |
resolve: (source, _args, context): Array<Node> => { |
@vladar, the code was changed following your suggestions. Thanks. |
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.
Awesome, thanks! 💜
Description
This PR converts the file packages/gatsby/src/schema/types/node-interface.js to TS.
Related Issue
Related to #21995