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

Sync tstypes/errors with flow #2105

Merged
merged 2 commits into from Aug 22, 2019

Conversation

JacksonKearl
Copy link

@JacksonKearl JacksonKearl commented Aug 22, 2019

One remaining diff is that in TS, we define formatError as

export interface GraphQLFormattedError<
  TExtensions extends Record<string, any> = Record<string, any>
> {
  readonly message: string;
  readonly locations?: ReadonlyArray<SourceLocation>;
  readonly path?: ReadonlyArray<string | number>;
  readonly extensions?: TExtensions;
}

whereas in flow, we define it like

export type GraphQLFormattedError = {|
  +message: string,
  +locations: $ReadOnlyArray<SourceLocation> | void,
  +path: $ReadOnlyArray<string | number> | void,
  +extensions?: { [key: string]: mixed, ... },
|};

(comments stripped)

Don't have much flow expereince, but playing in the playground, its saying that adding a type parameter is a breaking change (must use GraphQLFormattedError<>, even though the type has a defualt)

@IvanGoncharov IvanGoncharov merged commit 37161b2 into graphql:master Aug 22, 2019
@IvanGoncharov
Copy link
Member

@JacksonKearl Merged 🎉
Thanks a lot for separating .d.ts comments into a separate commit 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bug fix 🐞 requires increase of "patch" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants