Skip to content

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.

2 participants