Express-graphql: flow: Cannot call getGraphQLParams(...).then with function bound to onFulfill

Created on 4 Sep 2018  ยท  5Comments  ยท  Source: graphql/express-graphql

$ flow check --show-all-branches
Error โ”ˆ node_modules/express-graphql/dist/index.js.flow:158:13

Cannot call getGraphQLParams(...).then with function bound to onFulfill because in the return value:

  • Either OptionsData [1] is incompatible with Promise [2].
  • Or cannot call validationRules.concat because in type argument Item:

    • Either cannot call validate with validationRules bound to rules because mixed [3] is incompatible with ValidationRule [4] in array element.

    • Or cannot call validate with validationRules bound to rules because array type [5] is incompatible with ValidationRule [4] in array element.

        node_modules/express-graphql/dist/index.js.flow
    [1]  43โ”‚     ) => OptionsResult)
           :
 [5][3]  78โ”‚   validationRules?: ?Array<mixed>,
           :
        151โ”‚
        152โ”‚     // Parse the Request to get GraphQL request parameters.
        153โ”‚     return getGraphQLParams(request)
        154โ”‚       .then(graphQLParams => {
        155โ”‚         params = graphQLParams;
        156โ”‚         // Then, resolve the Options to get OptionsData.
        157โ”‚         return typeof options === 'function'
        158โ”‚           ? options(request, response, params) // ๐Ÿ”ฅ
        159โ”‚           : options;
        160โ”‚       })
        161โ”‚       .then(optionsData => {
        162โ”‚         // Assert that optionsData is in fact an Object.
        163โ”‚         if (!optionsData || typeof optionsData !== 'object') {

        /tmp/flow/flowlib_27f728ff/core.js
    [2] 595โ”‚       onFulfill: (value: R) => Promise<U> | U,

        node_modules/graphql/validation/validate.js.flow
    [4]  40โ”‚   rules?: $ReadOnlyArray<ValidationRule> = specifiedRules,
  • flow 0.80.0
  • express-graphql 0.6.12
  • graphql 14.0.0
  • everything at latest version (2018-09-04 02:40 UTC)
bug

Most helpful comment

@langpavel Thanks for reporting ๐Ÿ‘
Fixed on the master by https://github.com/graphql/express-graphql/commit/5c04d1838020f691cc3dc9b098635593a75e7a1d
I will try to release a new version in the next few days.

All 5 comments

@langpavel Thanks for reporting ๐Ÿ‘
Fixed on the master by https://github.com/graphql/express-graphql/commit/5c04d1838020f691cc3dc9b098635593a75e7a1d
I will try to release a new version in the next few days.

Thanks!

@IvanGoncharov Sorry to ask about this, but was this released?

@CoericK It was released yesterday as 0.7.1 ๐Ÿ“ฆ

Thanks @IvanGoncharov!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

naivefun picture naivefun  ยท  3Comments

macin40 picture macin40  ยท  4Comments

jamesmoriarty picture jamesmoriarty  ยท  4Comments

PavanBahuguni picture PavanBahuguni  ยท  3Comments

ivanhdzd picture ivanhdzd  ยท  3Comments