Skip to content

Commit 92bf37c

Browse files
authored
Merge pull request #50 from Yelp/fix_flow_interface_for_error_handler
Relax flow for the errorHandler, bump flow-bin and graphql in the examples
2 parents ad1dff4 + b4269dc commit 92bf37c

File tree

5 files changed

+32
-19
lines changed

5 files changed

+32
-19
lines changed

examples/swapi/.flowconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ unclear-type
44
unsafe-getters-setters
55
untyped-import
66
untyped-type-import
7+
8+
[lints]
9+
uninitialized-instance-property=error
10+
11+
[options]
12+
esproposal.optional_chaining=enable

examples/swapi/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"@babel/cli": "^7.8.4",
44
"@babel/node": "^7.7.0",
55
"@babel/preset-flow": "^7.0.0",
6-
"flow-bin": "0.111.3",
6+
"flow-bin": "0.122.0",
77
"flow-typed": "^2.6.2"
88
},
99
"dependencies": {
10-
"graphql": "15.0.0-alpha.1",
10+
"dataloader": "^2.0.0",
11+
"graphql": "15.0.0",
1112
"node-fetch": "^2.6.0"
1213
}
1314
}

examples/swapi/swapi-loaders.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/swapi/yarn.lock

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ crypt@~0.0.1:
546546
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
547547
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=
548548

549+
dataloader@^2.0.0:
550+
version "2.0.0"
551+
resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.0.0.tgz#41eaf123db115987e21ca93c005cd7753c55fe6f"
552+
integrity sha512-YzhyDAwA4TaQIhM5go+vCLmU0UikghC/t9DTQYZR2M/UvZ1MdOhPezSDZcjj9uqQJOMqjLcpWtyW2iNINdlatQ==
553+
549554
debug@^2.2.0, debug@^2.3.3:
550555
version "2.6.9"
551556
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@@ -759,10 +764,10 @@ find-up@^3.0.0:
759764
dependencies:
760765
locate-path "^3.0.0"
761766

762-
flow-bin@0.111.3:
763-
version "0.111.3"
764-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.111.3.tgz#8653a413400ebc966097a47c81fb4e6b722a5921"
765-
integrity sha512-Gn27aRTjSFicukZ/pq3raRERmSk9UWszhIK9eNtj6843L54YtK+jk2OkQWV70+VKi9LmWyfItCkhwoIVy7L2lA==
767+
flow-bin@0.122.0:
768+
version "0.122.0"
769+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.122.0.tgz#c723a2b33b1a70bd10204704ae1dc776d5d89d79"
770+
integrity sha512-my8N5jgl/A+UVby9E7NDppHdhLgRbWgKbmFZSx2MSYMRh3d9YGnM2MM+wexpUpl0ftY1IM6ZcUwaAhrypLyvlA==
766771

767772
flow-typed@^2.6.2:
768773
version "2.6.2"
@@ -934,12 +939,10 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
934939
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
935940
integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
936941

937-
938-
version "15.0.0-alpha.1"
939-
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.0.0-alpha.1.tgz#87b9a6b8825a8863e57ea1b1f261b1d406e88c63"
940-
integrity sha512-TB/CnOxBPo7+mqtYX0cuKcLYWLiwy9VgCWad9XcsrwfoGMuijiQH1CMsGKEhCirMN8FmRjm1o4C3MPn8PcOxxg==
941-
dependencies:
942-
iterall "^1.2.2"
942+
943+
version "15.0.0"
944+
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.0.0.tgz#042a5eb5e2506a2e2111ce41eb446a8e570b8be9"
945+
integrity sha512-ZyVO1xIF9F+4cxfkdhOJINM+51B06Friuv4M66W7HzUOeFd+vNzUn4vtswYINPi6sysjf1M2Ri/rwZALqgwbaQ==
943946

944947
has-flag@^3.0.0:
945948
version "3.0.0"
@@ -1250,11 +1253,6 @@ isurl@^1.0.0-alpha5:
12501253
has-to-string-tag-x "^1.2.0"
12511254
is-object "^1.0.1"
12521255

1253-
iterall@^1.2.2:
1254-
version "1.2.2"
1255-
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7"
1256-
integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==
1257-
12581256
js-tokens@^4.0.0:
12591257
version "4.0.0"
12601258
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"

src/codegen.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ export default function codegen(
8585
type ExtractPromisedReturnValue<A> = <R>((...A) => Promise<R>) => R;
8686
8787
export type DataLoaderCodegenOptions = {|
88-
errorHandler?: (resourcePath: $ReadOnlyArray<string>, error: any) => Promise<Error>,
88+
errorHandler?: (
89+
resourcePath: $ReadOnlyArray<string>,
90+
// $FlowFixMe: We don't know what type the resource might throw, so we have to type error to "any" :(
91+
error: any,
92+
) => Promise<Error>,
8993
resourceMiddleware?: {|
9094
before?: <T>(resourcePath: $ReadOnlyArray<string>, resourceArgs: T) => Promise<T>,
9195
after?: <T>(resourcePath: $ReadOnlyArray<string>, response: T) => Promise<T>,

0 commit comments

Comments
 (0)