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

Are there some plans to land flow-type exports in v0.6.0? #390

Closed
iamchenxin opened this issue May 18, 2016 · 1 comment
Closed

Are there some plans to land flow-type exports in v0.6.0? #390

iamchenxin opened this issue May 18, 2016 · 1 comment

Comments

@iamchenxin
Copy link
Contributor

iamchenxin commented May 18, 2016

Without standard flow-type outputs in graphql's package.
Some packages dependent on graphql get more and more wrong flow-type check.(used wrong type but type-check passed in that package).

Ex: graphql-relay-js,It used a subset of graphql.
But cause there is no flow-type output in graphql's standard npm package, so graphql-relay-js can do type check arbitrarily, this will lend to some bugs.
Like graphql-relay-js :

type typeResolverFn = (object: any) => ?GraphQLObjectType |
                      (object: any) => ?Promise<GraphQLObjectType>; // wrong ? type can not be resolved with a Promise?

vs grapgql's

export type GraphQLTypeResolveFn = (
  value: mixed,
  context: mixed,
  info: GraphQLResolveInfo
) => ?GraphQLObjectType

And also if there are type-outputs in graphql
Something in graphql(L469):

export type GraphQLFieldResolveFn = (
  source: mixed,
  args: {[argName: string]: mixed}, // should be modified to args:Object or some template?
  context: mixed,
  info: GraphQLResolveInfo
) => mixed

would be narrowed rightly in graph-relay like this:

type RelayFieldResolveFn = (
   source: Object,
   args: {'input':Object},
   context: mixed,
   info: GraphQLResolveInfo
 ) => mixed
@leebyron
Copy link
Contributor

Merging into #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants