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

chore(gatsby): Migrate types/node-interface.js to TypeScript #26733

Merged
merged 4 commits into from
Sep 17, 2020

Conversation

alisson-suzigan
Copy link
Contributor

@alisson-suzigan alisson-suzigan commented Sep 1, 2020

Description

This PR converts the file packages/gatsby/src/schema/types/node-interface.js to TS.

Related Issue

Related to #21995

@alisson-suzigan
Copy link
Contributor Author

Hi folks.
Does this PR still make sense?

@alisson-suzigan
Copy link
Contributor Author

Hello, is anyone there?

Copy link
Contributor

@vladar vladar left a 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 => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resolve: (source, _args, context): Node => {
resolve: (source, _args, context): Array<Node> => {

@vladar vladar self-assigned this Sep 15, 2020
@alisson-suzigan
Copy link
Contributor Author

alisson-suzigan commented Sep 17, 2020

@vladar, the code was changed following your suggestions. Thanks.

Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! 💜

@vladar vladar added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Sep 17, 2020
@gatsbybot gatsbybot merged commit de99e43 into gatsbyjs:master Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants