Graphql-js: Better Flow type defs for field resolvers

Created on 16 Nov 2016  路  7Comments  路  Source: graphql/graphql-js

When writing resolvers for GraphQL types in a flow-typed environment, the Flow types should aid as much as possible.

  • [x] Do not require casting through (: any) for typical behavior.
  • [ ] Proper typing of context
  • [ ] Proper typing of source
  • [ ] Proper typing of return
  • [ ] Proper typing of arguments
enhancement

Most helpful comment

@leebyron are you still working on this issue? Is there something I or others could help with?

All 7 comments

This was originally inspired by discussion in #554.

@leebyron is there any progress on this meta issue? It would really helpful to get end-to-end typing of the graph and the possibility of leveraging that in the client.

@leebyron are you still working on this issue? Is there something I or others could help with?

Has there been any additional consideration for what it will take to move forward with the remainder of the typings for resolvers?

@gtkatakura is using conditional mapped types to improve types: https://github.com/gtkatakura/fullstack-challenge/commit/36cc1050768e29824f7c7114d22c131d43aefef9

If it helps... proper typing of return (only for GraphQLScalarType) in TypeScript

https://github.com/gtkatakura/fullstack-challenge/commit/bc01861cb7f34fd5bc65b892ef9b33aedadab3e6

Was this page helpful?
0 / 5 - 0 ratings