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 withPromise
[2]
. - Or cannot call
validationRules.concat
because in type argumentItem
:- Either cannot call
validate
withvalidationRules
bound torules
becausemixed
[3]
is incompatible withValidationRule
[4]
in array element. - Or cannot call
validate
withvalidationRules
bound torules
becausearray type
[5]
is incompatible withValidationRule
[4]
in array element.
- Either cannot call
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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.
@CoericK It was released yesterday as
0.7.1
📦