question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

$ 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)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
IvanGoncharovcommented, Sep 4, 2018

@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.

1reaction
IvanGoncharovcommented, Oct 29, 2018

@CoericK It was released yesterday as 0.7.1 📦

Read more comments on GitHub >

github_iconTop Results From Across the Web

How call flow function by TypeScript - Stack Overflow
Now I'm developing an open source framework https://github.com/babyfish-ct/graphql-ts-client/ .In 3.X, I want to integrate with relay(not fully ...
Read more >
Iteration and Flow Control - Practical Modern JavaScript [Book]
Until the promise is settled by calling either function, it’ll be in a pending state and any reactions attached to it won’t be...
Read more >
node_modules/express-graphql · master - UTU GitLab
The GraphQL response allows for adding additional information in a response to a GraphQL query via a field in the response called "extensions"...
Read more >
Finding Broken Promises in Asynchronous JavaScript Programs
Once a promise has been fulfilled or rejected, its value cannot change, i.e. a promise can only be settled once. Each promise object...
Read more >
How to make the fastest Promise library | HackerNoon
When then is called, the parent's state is already not pending . In this case, if onFulfilled is called without anything, the function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found