Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Sync TS typings with Flow typings #622

Merged
merged 1 commit into from
Jun 8, 2020

Conversation

danielrearden
Copy link
Collaborator

This PR only changes the existing TS types.

@danielrearden
Copy link
Collaborator Author

@IvanGoncharov My current plan is to:

  • Fix existing types (this PR)
  • Break up the type declarations and move them into /src (this will also convert from using a namespace to ES module syntax)
  • Add any missing type declarations
  • Convert the tests to TS
  • Convert the rest of the files to TS, extracting the Flow typings

@coveralls
Copy link

coveralls commented Jun 7, 2020

Coverage Status

Coverage remained the same at 99.881% when pulling dc75d8c on danielrearden:sync-types into 81c7986 on graphql:master.

types/index.d.ts Outdated
@@ -56,64 +58,64 @@ declare namespace graphqlHTTP {
/**
* A value to pass as the context to the graphql() function.
*/
context?: unknown;
context?: Maybe<unknown>;
Copy link
Member

Choose a reason for hiding this comment

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

unknown should include null and undefined right?

Copy link
Member

Choose a reason for hiding this comment

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

I see it marked as ?mixed in Flow.
So this change is ok 👍

Copy link
Member

Choose a reason for hiding this comment

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

I think it can fixed in separate PR both in Flow and TS

types/index.d.ts Outdated

/**
* A boolean to configure whether the output should be pretty-printed.
*/
pretty?: boolean | null;
pretty?: Maybe<boolean>;
Copy link
Member

@IvanGoncharov IvanGoncharov Jun 8, 2020

Choose a reason for hiding this comment

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

One thing to note: after TS conversion we need to get rid of Maybe types, AFAIK they are not part of idiomatic TS and at that point would be just a legacy from the time that we used Flow.

IvanGoncharov added a commit to IvanGoncharov/express-graphql that referenced this pull request Jun 8, 2020
IvanGoncharov added a commit to IvanGoncharov/express-graphql that referenced this pull request Jun 8, 2020
IvanGoncharov added a commit that referenced this pull request Jun 8, 2020
@IvanGoncharov
Copy link
Member

@danielrearden Based on the previous comment I cleaned up Flow typings in #624
Can you please sync this PR?

My current plan is to:

Sounds good 👍

@IvanGoncharov IvanGoncharov added the PR: breaking change 💥 implementation requires increase of "major" version number label Jun 8, 2020
@IvanGoncharov IvanGoncharov merged commit 3ede973 into graphql:master Jun 8, 2020
junminstorage pushed a commit to junminstorage/express-graphql that referenced this pull request Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: breaking change 💥 implementation requires increase of "major" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants