diff --git a/.eslintignore b/.eslintignore index e170bede5d..220fcbb0f9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,4 +8,4 @@ examples/apollo-federation-compatibility/src/resolvers-types.ts **/dist **/.next **/.bob -**/.svelte-kit \ No newline at end of file +**/.svelte-kit diff --git a/examples/aws-lambda/lambda/CHANGELOG.md b/examples/aws-lambda/lambda/CHANGELOG.md deleted file mode 100644 index 51404b7b60..0000000000 --- a/examples/aws-lambda/lambda/CHANGELOG.md +++ /dev/null @@ -1,879 +0,0 @@ -# graphql-lambda - -## 3.10.3 - -### Patch Changes - -- Updated dependencies - [[`c93366d`](https://github.com/dotansimha/graphql-yoga/commit/c93366df8b4a2edd209d1eb94d989eaba3b7031b), - [`c93366d`](https://github.com/dotansimha/graphql-yoga/commit/c93366df8b4a2edd209d1eb94d989eaba3b7031b)]: - - graphql-yoga@5.10.3 - -## 3.10.2 - -### Patch Changes - -- Updated dependencies - [[`7a413bc`](https://github.com/dotansimha/graphql-yoga/commit/7a413bc4fac839fbdc4fbb3cd5241c7828b2f6da), - [`7a413bc`](https://github.com/dotansimha/graphql-yoga/commit/7a413bc4fac839fbdc4fbb3cd5241c7828b2f6da)]: - - graphql-yoga@5.10.2 - -## 3.10.1 - -### Patch Changes - -- Updated dependencies - [[`20cd9b6`](https://github.com/dotansimha/graphql-yoga/commit/20cd9b6cd58b507580e3d39621eb3dbc2ca4e781)]: - - graphql-yoga@5.10.1 - -## 3.10.0 - -### Patch Changes - -- Updated dependencies - [[`f81501c`](https://github.com/dotansimha/graphql-yoga/commit/f81501c70213330323a1d6ee9d45b3206af3675f)]: - - graphql-yoga@5.10.0 - -## 3.9.0 - -### Patch Changes - -- Updated dependencies - [[`2523d9f`](https://github.com/dotansimha/graphql-yoga/commit/2523d9fa954b82e11412918aab2ae6fe7e7611d6), - [`87ee333`](https://github.com/dotansimha/graphql-yoga/commit/87ee333724c0c6e0b9f72aa50e38a0a8a080593f)]: - - graphql-yoga@5.9.0 - -## 3.8.0 - -### Patch Changes - -- Updated dependencies - [[`18fe916`](https://github.com/dotansimha/graphql-yoga/commit/18fe916853fc6192b8b2a607f91b67f3a7cae7bc), - [`6bb19ed`](https://github.com/dotansimha/graphql-yoga/commit/6bb19edf5b103d6d9b6088e2e22cfa71a85f26f7)]: - - graphql-yoga@5.8.0 - -## 3.7.0 - -### Patch Changes - -- Updated dependencies - [[`5dae4ab`](https://github.com/dotansimha/graphql-yoga/commit/5dae4abeb6a4aa82f396a19d31d0155fe10bc752), - [`5dae4ab`](https://github.com/dotansimha/graphql-yoga/commit/5dae4abeb6a4aa82f396a19d31d0155fe10bc752), - [`5dae4ab`](https://github.com/dotansimha/graphql-yoga/commit/5dae4abeb6a4aa82f396a19d31d0155fe10bc752), - [`5dae4ab`](https://github.com/dotansimha/graphql-yoga/commit/5dae4abeb6a4aa82f396a19d31d0155fe10bc752)]: - - graphql-yoga@5.7.0 - -## 3.6.3 - -### Patch Changes - -- Updated dependencies - [[`0866c1b`](https://github.com/dotansimha/graphql-yoga/commit/0866c1be8868eb891a0a62e36c9270d87f205330)]: - - graphql-yoga@5.6.3 - -## 3.6.2 - -### Patch Changes - -- Updated dependencies - [[`b7bf47b`](https://github.com/dotansimha/graphql-yoga/commit/b7bf47bf72f3c04de6de7866aa68cdd5eac90566), - [`81a736b`](https://github.com/dotansimha/graphql-yoga/commit/81a736be76cb91049fc9ef54f536ce79e0c90e16)]: - - graphql-yoga@5.6.2 - -## 3.6.1 - -### Patch Changes - -- Updated dependencies - [[`4252e3d`](https://github.com/dotansimha/graphql-yoga/commit/4252e3d0e664e3c247c709cd47a0645c68dc527a)]: - - graphql-yoga@5.6.1 - -## 3.6.0 - -### Patch Changes - -- Updated dependencies - [[`9f3f945`](https://github.com/dotansimha/graphql-yoga/commit/9f3f94522a9e8a7a19657efdd445a360ec244d55)]: - - graphql-yoga@5.6.0 - -## 3.5.0 - -### Patch Changes - -- Updated dependencies - [[`0208024`](https://github.com/dotansimha/graphql-yoga/commit/02080249adb8b120d44a89126571145dc3be8e4e)]: - - graphql-yoga@5.5.0 - -## 3.4.0 - -### Patch Changes - -- Updated dependencies - [[`4cd43b9`](https://github.com/dotansimha/graphql-yoga/commit/4cd43b9ff56ad9358dc897f4bb87a6a94f953047), - [`fdd902c`](https://github.com/dotansimha/graphql-yoga/commit/fdd902c2a713c6bd951e1b1e6570164b6ff2d546), - [`d5dfe99`](https://github.com/dotansimha/graphql-yoga/commit/d5dfe99af030a5afac26968ba8dd81dee6df0dc2), - [`7335a82`](https://github.com/dotansimha/graphql-yoga/commit/7335a82a4b0696c464311a5027a43b16c7f68156), - [`f9aa1cd`](https://github.com/dotansimha/graphql-yoga/commit/f9aa1cdc968816a9f83f054dbd24799c85f71a2c)]: - - graphql-yoga@5.4.0 - -## 3.3.1 - -### Patch Changes - -- Updated dependencies - [[`3324bbab`](https://github.com/dotansimha/graphql-yoga/commit/3324bbabf1f32e8b4ee95ea8700acfb06f87f8ca), - [`3324bbab`](https://github.com/dotansimha/graphql-yoga/commit/3324bbabf1f32e8b4ee95ea8700acfb06f87f8ca)]: - - graphql-yoga@5.3.1 - -## 3.3.0 - -### Patch Changes - -- Updated dependencies - [[`f775b341`](https://github.com/dotansimha/graphql-yoga/commit/f775b341729145cee68747ab966aa9f4a9ea0389), - [`f775b341`](https://github.com/dotansimha/graphql-yoga/commit/f775b341729145cee68747ab966aa9f4a9ea0389), - [`f89a1aa2`](https://github.com/dotansimha/graphql-yoga/commit/f89a1aa2a0bd6efc145627a674370b1b22e231fa)]: - - graphql-yoga@5.3.0 - -## 3.2.0 - -### Patch Changes - -- Updated dependencies - [[`71db7548`](https://github.com/dotansimha/graphql-yoga/commit/71db754876612bb9a1df496f478eaf1b94f342cf), - [`71db7548`](https://github.com/dotansimha/graphql-yoga/commit/71db754876612bb9a1df496f478eaf1b94f342cf)]: - - graphql-yoga@5.2.0 - -## 3.1.1 - -### Patch Changes - -- Updated dependencies - [[`3ef877a7`](https://github.com/dotansimha/graphql-yoga/commit/3ef877a75c5b19e082121ece08981183422618f0)]: - - graphql-yoga@5.1.1 - -## 3.1.0 - -### Patch Changes - -- Updated dependencies - [[`b1f0e3a2`](https://github.com/dotansimha/graphql-yoga/commit/b1f0e3a2986956c6791a251df908e3f8b50ec966)]: - - graphql-yoga@5.1.0 - -## 3.0.2 - -### Patch Changes - -- Updated dependencies - [[`77d107fe`](https://github.com/dotansimha/graphql-yoga/commit/77d107fe1a01044f4ba017ca960bb1bd58407ed7)]: - - graphql-yoga@5.0.2 - -## 3.0.1 - -### Patch Changes - -- Updated dependencies - [[`3fea19f2`](https://github.com/dotansimha/graphql-yoga/commit/3fea19f2a01c85b7d837163d763fae107e8f5a53)]: - - graphql-yoga@5.0.1 - -## 3.0.0 - -### Patch Changes - -- Updated dependencies - [[`01430e03`](https://github.com/dotansimha/graphql-yoga/commit/01430e03288f072a9cb09b0b898316b1f5b58a5f), - [`5b615478`](https://github.com/dotansimha/graphql-yoga/commit/5b6154783957874281bdf180575cdf57fadb75bf), - [`350bb851`](https://github.com/dotansimha/graphql-yoga/commit/350bb85195c01cc5b5721f7a90f6cfbe1af36aff)]: - - graphql-yoga@5.0.0 - -## 2.0.5 - -### Patch Changes - -- Updated dependencies - [[`bf602edf`](https://github.com/dotansimha/graphql-yoga/commit/bf602edf790590de1db26b5f3fc39f895104055c)]: - - graphql-yoga@4.0.5 - -## 2.0.4 - -### Patch Changes - -- Updated dependencies - [[`5f182006`](https://github.com/dotansimha/graphql-yoga/commit/5f1820066e8a340ad214b55232fcf439793f91bf)]: - - graphql-yoga@4.0.4 - -## 2.0.3 - -### Patch Changes - -- Updated dependencies - [[`5efb8250`](https://github.com/dotansimha/graphql-yoga/commit/5efb82502da245f2fe730cc18f4af283d31a835c)]: - - graphql-yoga@4.0.3 - -## 2.0.2 - -### Patch Changes - -- Updated dependencies - [[`ce6d2465`](https://github.com/dotansimha/graphql-yoga/commit/ce6d24655eb3c59d9a506baf09dbe185da9a8b2b)]: - - graphql-yoga@4.0.2 - -## 2.0.1 - -### Patch Changes - -- Updated dependencies - [[`bb739b05`](https://github.com/dotansimha/graphql-yoga/commit/bb739b0555e67a9ee40da9343cec323463a0f568), - [`8f7d7abc`](https://github.com/dotansimha/graphql-yoga/commit/8f7d7abc7f71de33e428ea74f2903290f2b4ed70)]: - - graphql-yoga@4.0.1 - -## 2.0.0 - -### Patch Changes - -- Updated dependencies - [[`4228c1d5`](https://github.com/dotansimha/graphql-yoga/commit/4228c1d54ed785fac1fb9669d861ed46659872ca), - [`34ecb4bb`](https://github.com/dotansimha/graphql-yoga/commit/34ecb4bbad3823f1bfde8aa7e1e92139481f9daf), - [`ec318fe6`](https://github.com/dotansimha/graphql-yoga/commit/ec318fe6d3945190abbe8b643223268ff9a5e0e9), - [`cc370691`](https://github.com/dotansimha/graphql-yoga/commit/cc370691cc525fe5b15cb846c60621d99d313310), - [`b309ca0d`](https://github.com/dotansimha/graphql-yoga/commit/b309ca0db1c45264878c3cec0137c3fdbd22fc97), - [`dd699c4b`](https://github.com/dotansimha/graphql-yoga/commit/dd699c4bcef24b373ee49237c187df3f093e1dfc), - [`4228c1d5`](https://github.com/dotansimha/graphql-yoga/commit/4228c1d54ed785fac1fb9669d861ed46659872ca), - [`0522c740`](https://github.com/dotansimha/graphql-yoga/commit/0522c7408c69a1b72af5c220411cf19d7fa859e9)]: - - graphql-yoga@4.0.0 - -## 1.9.1 - -### Patch Changes - -- Updated dependencies - [[`e1a60e21`](https://github.com/dotansimha/graphql-yoga/commit/e1a60e21f10813aa6d0f4673e4eb13979720c2c8), - [`c50ea51c`](https://github.com/dotansimha/graphql-yoga/commit/c50ea51c992a6a480799655225727081585f0010), - [`c50ea51c`](https://github.com/dotansimha/graphql-yoga/commit/c50ea51c992a6a480799655225727081585f0010)]: - - graphql-yoga@3.9.1 - -## 1.9.0 - -### Patch Changes - -- Updated dependencies - [[`aff69200`](https://github.com/dotansimha/graphql-yoga/commit/aff69200d512c530751c617ee685f9b3f82303f8)]: - - graphql-yoga@3.9.0 - -## 1.8.1 - -### Patch Changes - -- Updated dependencies - [[`ebb65b14`](https://github.com/dotansimha/graphql-yoga/commit/ebb65b14b29bbb4c50c6bb242262444315e99a73), - [`528941cb`](https://github.com/dotansimha/graphql-yoga/commit/528941cb4d1670833ee0307de0c715e6b9681d7a)]: - - graphql-yoga@3.8.1 - -## 1.8.0 - -### Patch Changes - -- Updated dependencies - [[`99b72696`](https://github.com/dotansimha/graphql-yoga/commit/99b726961b45b9c22d6383e2fe7212d21d324553), - [`99b72696`](https://github.com/dotansimha/graphql-yoga/commit/99b726961b45b9c22d6383e2fe7212d21d324553), - [`09d23a4b`](https://github.com/dotansimha/graphql-yoga/commit/09d23a4b3b22f520c41f3cebbe3b11ffbda39557)]: - - graphql-yoga@3.8.0 - -## 1.7.3 - -### Patch Changes - -- Updated dependencies - [[`46e75917`](https://github.com/dotansimha/graphql-yoga/commit/46e75917f784abcb4ea9968bf3d73660df157b21)]: - - graphql-yoga@3.7.3 - -## 1.7.2 - -### Patch Changes - -- Updated dependencies - [[`7ad50529`](https://github.com/dotansimha/graphql-yoga/commit/7ad505294ecccf21a0449b739c359396bc97121f)]: - - graphql-yoga@3.7.2 - -## 1.7.1 - -### Patch Changes - -- Updated dependencies - [[`9fdd94b5`](https://github.com/dotansimha/graphql-yoga/commit/9fdd94b5697b55693a2a7bd48a2da4c3ba8ac3f8), - [`47b1c4a4`](https://github.com/dotansimha/graphql-yoga/commit/47b1c4a4fa72043b02307822395c016bd523f949), - [`02ac055c`](https://github.com/dotansimha/graphql-yoga/commit/02ac055cad3f7cb0fb08bb003a8a1971e4f48a23), - [`02ac055c`](https://github.com/dotansimha/graphql-yoga/commit/02ac055cad3f7cb0fb08bb003a8a1971e4f48a23)]: - - graphql-yoga@3.7.1 - -## 1.7.0 - -### Patch Changes - -- Updated dependencies - [[`23d1b26c`](https://github.com/dotansimha/graphql-yoga/commit/23d1b26cde5d86e21deb74846348e077b4fdf620), - [`9e743db5`](https://github.com/dotansimha/graphql-yoga/commit/9e743db5f43a8e6e5944667ddec349005dbb2cd9), - [`23d1b26c`](https://github.com/dotansimha/graphql-yoga/commit/23d1b26cde5d86e21deb74846348e077b4fdf620)]: - - graphql-yoga@3.7.0 - -## 1.6.1 - -### Patch Changes - -- Updated dependencies - [[`3c8c8434`](https://github.com/dotansimha/graphql-yoga/commit/3c8c843409fa1c06873d8599ebd7b02f6819dad4)]: - - graphql-yoga@3.6.1 - -## 1.6.0 - -### Patch Changes - -- Updated dependencies - [[`790330be`](https://github.com/dotansimha/graphql-yoga/commit/790330beac3e6f2e85e128f9df9ba0bb1c53d5f5), - [`6bc1410f`](https://github.com/dotansimha/graphql-yoga/commit/6bc1410f0d23dd88dfc708dad8dceecfaa5fab78), - [`ddb2607d`](https://github.com/dotansimha/graphql-yoga/commit/ddb2607d5495245b360e29e38b826609ff93f2ce), - [`6bc1410f`](https://github.com/dotansimha/graphql-yoga/commit/6bc1410f0d23dd88dfc708dad8dceecfaa5fab78), - [`1caac99b`](https://github.com/dotansimha/graphql-yoga/commit/1caac99b39a09594d54402665a852e2933f0b7da), - [`790330be`](https://github.com/dotansimha/graphql-yoga/commit/790330beac3e6f2e85e128f9df9ba0bb1c53d5f5), - [`7587d5c5`](https://github.com/dotansimha/graphql-yoga/commit/7587d5c575bffb746d611cbbce36d2ee5cbe4f69), - [`cc0d3899`](https://github.com/dotansimha/graphql-yoga/commit/cc0d389912538f2dd290976a738f1b09f1d87b8d), - [`a747d249`](https://github.com/dotansimha/graphql-yoga/commit/a747d24976de5ed6bd05013ba451bffea05f4e8c), - [`2933fc89`](https://github.com/dotansimha/graphql-yoga/commit/2933fc895702a26d13a466035e0d613629f569ec), - [`543e490b`](https://github.com/dotansimha/graphql-yoga/commit/543e490b12e4b86934133e8c6cd08450247451c1)]: - - graphql-yoga@3.6.0 - -## 1.5.1 - -### Patch Changes - -- Updated dependencies - [[`3a8446df`](https://github.com/dotansimha/graphql-yoga/commit/3a8446dfb50c6d234e030cd1e4260c5de9daefc4)]: - - graphql-yoga@3.5.1 - -## 1.5.0 - -### Patch Changes - -- Updated dependencies - [[`03597a5a`](https://github.com/dotansimha/graphql-yoga/commit/03597a5accfab9aa10380188e1fd0b7c0727a59c)]: - - graphql-yoga@3.5.0 - -## 1.4.1 - -### Patch Changes - -- Updated dependencies - [[`00843174`](https://github.com/dotansimha/graphql-yoga/commit/008431747787dd6c6b26f4cb44c7c6f3053f162e), - [`00843174`](https://github.com/dotansimha/graphql-yoga/commit/008431747787dd6c6b26f4cb44c7c6f3053f162e)]: - - graphql-yoga@3.4.1 - -## 1.4.0 - -### Patch Changes - -- Updated dependencies - [[`76c1ecb9`](https://github.com/dotansimha/graphql-yoga/commit/76c1ecb985887ee45f0f934216b7a629e3c2db6d), - [`8cd8b5a5`](https://github.com/dotansimha/graphql-yoga/commit/8cd8b5a5ab1dd28e2a2ddd7424c98c0493c535ad), - [`6e8bddba`](https://github.com/dotansimha/graphql-yoga/commit/6e8bddba7eb21b596cea0a2d4c313bb84a5c3aa1), - [`6ee252db`](https://github.com/dotansimha/graphql-yoga/commit/6ee252dbed6f38840284bbe47c72c453ac8e648b), - [`8f139e15`](https://github.com/dotansimha/graphql-yoga/commit/8f139e155b5cd59ca97912cccdc45b8b7d2909e6), - [`9beef914`](https://github.com/dotansimha/graphql-yoga/commit/9beef91485e076f19928e73fdc65aa2979f88eef), - [`c46d75e8`](https://github.com/dotansimha/graphql-yoga/commit/c46d75e82456d7aecd8e562cf85bd314d19d2a97), - [`f9ab8a70`](https://github.com/dotansimha/graphql-yoga/commit/f9ab8a70a5498ea8bb924a01b9873f439bd1a0c8)]: - - graphql-yoga@3.4.0 - -## 1.3.1 - -### Patch Changes - -- Updated dependencies - [[`d4dab446`](https://github.com/dotansimha/graphql-yoga/commit/d4dab446046695932a92ea4ccabb537a57bf3d00)]: - - graphql-yoga@3.3.1 - -## 1.3.0 - -### Patch Changes - -- Updated dependencies - [[`3e5f688f`](https://github.com/dotansimha/graphql-yoga/commit/3e5f688f2cbe02dd2fb4be69831d268aee52c5b5), - [`3e5f688f`](https://github.com/dotansimha/graphql-yoga/commit/3e5f688f2cbe02dd2fb4be69831d268aee52c5b5), - [`8b288a23`](https://github.com/dotansimha/graphql-yoga/commit/8b288a23c882ec643406c7e3cf7a19980abdd381)]: - - graphql-yoga@3.3.0 - -## 1.2.1 - -### Patch Changes - -- Updated dependencies - [[`5528d312`](https://github.com/dotansimha/graphql-yoga/commit/5528d312d46281651b330c12f1b9f7a7d64ef3da)]: - - graphql-yoga@3.2.1 - -## 1.2.0 - -### Patch Changes - -- Updated dependencies - [[`a86aaa0f`](https://github.com/dotansimha/graphql-yoga/commit/a86aaa0f673037e9207ca12e48f54e7e43963a47), - [`82f58934`](https://github.com/dotansimha/graphql-yoga/commit/82f5893446e3c55519194a1ca1d784120cbe7098), - [`290c7f7f`](https://github.com/dotansimha/graphql-yoga/commit/290c7f7fde5e604b2a8ac90f93b15e143ea09a92)]: - - graphql-yoga@3.2.0 - -## 1.1.2 - -### Patch Changes - -- Updated dependencies - [[`c5b1cc46`](https://github.com/dotansimha/graphql-yoga/commit/c5b1cc46f67c4516fcaeb6247f56da4ca7dd7511), - [`c152105e`](https://github.com/dotansimha/graphql-yoga/commit/c152105eeed34be2f6380406739a57310729f353), - [`26d780cd`](https://github.com/dotansimha/graphql-yoga/commit/26d780cd683b15d38880387081455311b57da4ec), - [`d2958781`](https://github.com/dotansimha/graphql-yoga/commit/d2958781d4f3959f89056092f6f12a2953f5497b)]: - - graphql-yoga@3.1.2 - -## 1.1.1 - -### Patch Changes - -- Updated dependencies - [[`534780c9`](https://github.com/dotansimha/graphql-yoga/commit/534780c99ed61dd761826d44d99a83748630cb61)]: - - graphql-yoga@3.1.1 - -## 1.1.0 - -### Patch Changes - -- Updated dependencies - [[`86fe453c`](https://github.com/dotansimha/graphql-yoga/commit/86fe453c0ae1183af62359df0d61bba421d9f627), - [`ea81e1dd`](https://github.com/dotansimha/graphql-yoga/commit/ea81e1dda6c074e384221f19bd8a925693fa3427), - [`ea81e1dd`](https://github.com/dotansimha/graphql-yoga/commit/ea81e1dda6c074e384221f19bd8a925693fa3427)]: - - graphql-yoga@3.1.0 - -## 1.0.3 - -### Patch Changes - -- Updated dependencies - [[`491ef5da`](https://github.com/dotansimha/graphql-yoga/commit/491ef5da7c6bcc3038fdb0909fd333a2b5217046)]: - - graphql-yoga@3.0.3 - -## 1.0.2 - -### Patch Changes - -- Updated dependencies - [[`0007c58d`](https://github.com/dotansimha/graphql-yoga/commit/0007c58d3ebc13cac694e561409fb2578ca5b882), - [`39a8fe89`](https://github.com/dotansimha/graphql-yoga/commit/39a8fe8977ec3c85d5ce5c643002aa79e6283f79)]: - - graphql-yoga@3.0.2 - -## 1.0.1 - -### Patch Changes - -- Updated dependencies - [[`d63fe841`](https://github.com/dotansimha/graphql-yoga/commit/d63fe84157662896c372feb013b73c6f290a2d3b)]: - - graphql-yoga@3.0.1 - -## 1.0.0 - -### Patch Changes - -- Updated dependencies - [[`2e0c4824`](https://github.com/dotansimha/graphql-yoga/commit/2e0c482418af2281c9cf0c34dd16f207d850cdb7), - [`8773a27f`](https://github.com/dotansimha/graphql-yoga/commit/8773a27ffb7f50a4b1f8c044d2a0c428d14e4fee), - [`720898db`](https://github.com/dotansimha/graphql-yoga/commit/720898dbf923a7aa52ff63e50e25527be1e8921b), - [`9f991a27`](https://github.com/dotansimha/graphql-yoga/commit/9f991a2767d374f1d6ab37445e65f748d5a1fe6d), - [`6e250209`](https://github.com/dotansimha/graphql-yoga/commit/6e25020916670fb50fecb5ff7c25f7216db3d78a), - [`cebca219`](https://github.com/dotansimha/graphql-yoga/commit/cebca219c4913f45509c3a40f0f5aa6697f5914d), - [`eeaced00`](https://github.com/dotansimha/graphql-yoga/commit/eeaced008fdd1b209d6db81f3351803f2a0a1089), - [`74e1f830`](https://github.com/dotansimha/graphql-yoga/commit/74e1f830b09bc21a970f7468af1363a22b8b592b), - [`e7a47b56`](https://github.com/dotansimha/graphql-yoga/commit/e7a47b56fbdf3abbb8f0d590ade867805a84157e), - [`5f5b1160`](https://github.com/dotansimha/graphql-yoga/commit/5f5b116084cff45ed49f0c74cc449ff20fd775ac), - [`1d7f810a`](https://github.com/dotansimha/graphql-yoga/commit/1d7f810a8ee3fc00f6dbde461010683eb354da2d), - [`209b1620`](https://github.com/dotansimha/graphql-yoga/commit/209b1620055cf64647943b1c334852a314aff3a4), - [`098e139f`](https://github.com/dotansimha/graphql-yoga/commit/098e139f2b08196bfee04a71bcd024501dceacd8), - [`73e56068`](https://github.com/dotansimha/graphql-yoga/commit/73e56068fd1c1c06a0cf08150d5b79ce7c49992a), - [`02d2aecd`](https://github.com/dotansimha/graphql-yoga/commit/02d2aecdee55e4c54454c48c2ca0fd7425796ae0), - [`74e1f830`](https://github.com/dotansimha/graphql-yoga/commit/74e1f830b09bc21a970f7468af1363a22b8b592b), - [`c4b3a9c8`](https://github.com/dotansimha/graphql-yoga/commit/c4b3a9c8031f7b61420bb9cdc4bc6e7fc22615a5), - [`b079c93b`](https://github.com/dotansimha/graphql-yoga/commit/b079c93ba47dc94d58f7d2b738a9423c29a149a1), - [`71554172`](https://github.com/dotansimha/graphql-yoga/commit/715541729f76be82d9f959a96e7af6126836df87), - [`b19a9104`](https://github.com/dotansimha/graphql-yoga/commit/b19a910447d27e2203bb5e22aaba6ab72d54b560), - [`1d5cde96`](https://github.com/dotansimha/graphql-yoga/commit/1d5cde96ce5b7647de7d329f9f56e398463a9152), - [`44878a5b`](https://github.com/dotansimha/graphql-yoga/commit/44878a5b1be937ab0ffefccc327400c80bd62847), - [`1d508495`](https://github.com/dotansimha/graphql-yoga/commit/1d50849526f5a8b23beac3c542826a70ac286ae7)]: - - graphql-yoga@3.0.0 - -## 1.0.0-next.12 - -### Patch Changes - -- Updated dependencies - [[`73e56068`](https://github.com/dotansimha/graphql-yoga/commit/73e56068fd1c1c06a0cf08150d5b79ce7c49992a)]: - - graphql-yoga@3.0.0-next.12 - -## 1.0.0-next.11 - -### Patch Changes - -- Updated dependencies - [[`720898db`](https://github.com/dotansimha/graphql-yoga/commit/720898dbf923a7aa52ff63e50e25527be1e8921b), - [`9f991a27`](https://github.com/dotansimha/graphql-yoga/commit/9f991a2767d374f1d6ab37445e65f748d5a1fe6d), - [`ef191eee`](https://github.com/dotansimha/graphql-yoga/commit/ef191eeeba63d96a4a141126c6fc5f4cf992e2d2)]: - - graphql-yoga@3.0.0-next.11 - -## 1.0.0-next.10 - -### Patch Changes - -- Updated dependencies - [[`8773a27f`](https://github.com/dotansimha/graphql-yoga/commit/8773a27ffb7f50a4b1f8c044d2a0c428d14e4fee), - [`cedde92f`](https://github.com/dotansimha/graphql-yoga/commit/cedde92fead65bcc4c08bb31d4c2400f92fd83d2), - [`bf69a561`](https://github.com/dotansimha/graphql-yoga/commit/bf69a561b3c18b8b2736c2a72da0a59244f6f62b)]: - - graphql-yoga@3.0.0-next.10 - -## 1.0.0-next.9 - -### Patch Changes - -- Updated dependencies - [[`b19a9104`](https://github.com/dotansimha/graphql-yoga/commit/b19a910447d27e2203bb5e22aaba6ab72d54b560), - [`87a6c333`](https://github.com/dotansimha/graphql-yoga/commit/87a6c3331a81503c07f211296e75ca0c5e060f0a)]: - - graphql-yoga@3.0.0-next.9 - -## 1.0.0-next.8 - -### Patch Changes - -- Updated dependencies - [[`6e250209`](https://github.com/dotansimha/graphql-yoga/commit/6e25020916670fb50fecb5ff7c25f7216db3d78a)]: - - graphql-yoga@3.0.0-next.8 - -## 1.0.0-next.7 - -### Patch Changes - -- Updated dependencies - [[`cebca219`](https://github.com/dotansimha/graphql-yoga/commit/cebca219c4913f45509c3a40f0f5aa6697f5914d), - [`5f5b1160`](https://github.com/dotansimha/graphql-yoga/commit/5f5b116084cff45ed49f0c74cc449ff20fd775ac)]: - - graphql-yoga@3.0.0-next.7 - -## 1.0.0-next.6 - -### Patch Changes - -- Updated dependencies - [[`dc45a7b5`](https://github.com/dotansimha/graphql-yoga/commit/dc45a7b57d4248501429c1bf66c0cd6ca36926fd)]: - - graphql-yoga@3.0.0-next.6 - -## 1.0.0-next.5 - -### Patch Changes - -- Updated dependencies - [[`71554172`](https://github.com/dotansimha/graphql-yoga/commit/715541729f76be82d9f959a96e7af6126836df87)]: - - graphql-yoga@3.0.0-next.5 - -## 1.0.0-next.4 - -### Patch Changes - -- Updated dependencies - [[`02d2aecd`](https://github.com/dotansimha/graphql-yoga/commit/02d2aecdee55e4c54454c48c2ca0fd7425796ae0), - [`b079c93b`](https://github.com/dotansimha/graphql-yoga/commit/b079c93ba47dc94d58f7d2b738a9423c29a149a1)]: - - graphql-yoga@3.0.0-next.4 - -## 1.0.0-next.3 - -### Patch Changes - -- Updated dependencies - [[`64e06d74`](https://github.com/dotansimha/graphql-yoga/commit/64e06d74132a118f30b42b51c0e71abced0506a4)]: - - graphql-yoga@3.0.0-next.3 - -## 1.0.0-next.2 - -### Patch Changes - -- Updated dependencies - [[`8c674c36`](https://github.com/dotansimha/graphql-yoga/commit/8c674c365e0bac176ca296e8d531fcd28d228d5b)]: - - graphql-yoga@3.0.0-next.2 - -## 1.0.0-next.1 - -### Patch Changes - -- Updated dependencies - [[`44878a5b`](https://github.com/dotansimha/graphql-yoga/commit/44878a5b1be937ab0ffefccc327400c80bd62847)]: - - graphql-yoga@3.0.0-next.1 - -## 1.0.0-next.0 - -### Patch Changes - -- Updated dependencies - [[`2e0c4824`](https://github.com/dotansimha/graphql-yoga/commit/2e0c482418af2281c9cf0c34dd16f207d850cdb7), - [`f46addd7`](https://github.com/dotansimha/graphql-yoga/commit/f46addd767f38bc3a48d796b0f2cb02c5f5668ef), - [`f4b23387`](https://github.com/dotansimha/graphql-yoga/commit/f4b233876c2db52886eb5211b029377450fdb7f1), - [`eeaced00`](https://github.com/dotansimha/graphql-yoga/commit/eeaced008fdd1b209d6db81f3351803f2a0a1089), - [`74e1f830`](https://github.com/dotansimha/graphql-yoga/commit/74e1f830b09bc21a970f7468af1363a22b8b592b), - [`e7a47b56`](https://github.com/dotansimha/graphql-yoga/commit/e7a47b56fbdf3abbb8f0d590ade867805a84157e), - [`1d7f810a`](https://github.com/dotansimha/graphql-yoga/commit/1d7f810a8ee3fc00f6dbde461010683eb354da2d), - [`209b1620`](https://github.com/dotansimha/graphql-yoga/commit/209b1620055cf64647943b1c334852a314aff3a4), - [`098e139f`](https://github.com/dotansimha/graphql-yoga/commit/098e139f2b08196bfee04a71bcd024501dceacd8), - [`74e1f830`](https://github.com/dotansimha/graphql-yoga/commit/74e1f830b09bc21a970f7468af1363a22b8b592b), - [`c4b3a9c8`](https://github.com/dotansimha/graphql-yoga/commit/c4b3a9c8031f7b61420bb9cdc4bc6e7fc22615a5), - [`1d5cde96`](https://github.com/dotansimha/graphql-yoga/commit/1d5cde96ce5b7647de7d329f9f56e398463a9152)]: - - graphql-yoga@3.0.0-next.0 - -## 0.13.11 - -### Patch Changes - -- Updated dependencies []: - - @graphql-yoga/node@2.13.11 - -## 0.13.10 - -### Patch Changes - -- Updated dependencies - [[`779b55ee`](https://github.com/dotansimha/graphql-yoga/commit/779b55eea843bd282f659e1012f255f62fd888b6)]: - - @graphql-yoga/node@2.13.10 - -## 0.13.9 - -### Patch Changes - -- Updated dependencies []: - - @graphql-yoga/node@2.13.9 - -## 0.13.8 - -### Patch Changes - -- Updated dependencies []: - - @graphql-yoga/node@2.13.8 - -## 0.13.7 - -### Patch Changes - -- Updated dependencies - [[`e4e8ade`](https://github.com/dotansimha/graphql-yoga/commit/e4e8ade526c2aec7ea28218ca7795e96b867fc6b), - [`94b41f3`](https://github.com/dotansimha/graphql-yoga/commit/94b41f30f598afb37db2438c736764e2a539cd10)]: - - @graphql-yoga/node@2.13.7 - -## 0.13.6 - -### Patch Changes - -- Updated dependencies [eecf24c] - - @graphql-yoga/node@2.13.6 - -## 0.13.5 - -### Patch Changes - -- Updated dependencies [c00dad3] - - @graphql-yoga/node@2.13.5 - -## 0.13.4 - -### Patch Changes - -- @graphql-yoga/node@2.13.4 - -## 0.13.3 - -### Patch Changes - -- Updated dependencies [639607d] - - @graphql-yoga/node@2.13.3 - -## 0.13.2 - -### Patch Changes - -- @graphql-yoga/node@2.13.2 - -## 0.13.1 - -### Patch Changes - -- @graphql-yoga/node@2.13.1 - -## 0.13.0 - -### Patch Changes - -- @graphql-yoga/node@2.13.0 - -## 0.12.0 - -### Patch Changes - -- @graphql-yoga/node@2.12.0 - -## 0.11.2 - -### Patch Changes - -- Updated dependencies [ca5f940] - - @graphql-yoga/node@2.11.2 - -## 0.11.1 - -### Patch Changes - -- Updated dependencies [9248df8] - - @graphql-yoga/node@2.11.1 - -## 0.11.0 - -### Patch Changes - -- Updated dependencies [8947657] - - @graphql-yoga/node@2.11.0 - -## 0.10.0 - -### Patch Changes - -- Updated dependencies [7de07cd] -- Updated dependencies [8922c3b] - - @graphql-yoga/node@2.10.0 - -## 0.9.2 - -### Patch Changes - -- @graphql-yoga/node@2.9.2 - -## 0.9.1 - -### Patch Changes - -- @graphql-yoga/node@2.9.1 - -## 0.9.0 - -### Patch Changes - -- Updated dependencies [06652c7] -- Updated dependencies [2d3c54c] - - @graphql-yoga/node@2.9.0 - -## 0.8.0 - -### Patch Changes - -- @graphql-yoga/node@2.8.0 - -## 0.7.0 - -### Patch Changes - -- @graphql-yoga/node@2.7.0 - -## 0.6.1 - -### Patch Changes - -- Updated dependencies [0224bf9] - - @graphql-yoga/node@2.6.1 - -## 0.6.0 - -### Patch Changes - -- @graphql-yoga/node@2.6.0 - -## 0.5.0 - -### Patch Changes - -- Updated dependencies [8b6d896] - - @graphql-yoga/node@2.5.0 - -## 0.4.1 - -### Patch Changes - -- @graphql-yoga/node@2.4.1 - -## 0.4.0 - -### Patch Changes - -- Updated dependencies [28e24c3] -- Updated dependencies [13f96db] - - @graphql-yoga/node@2.4.0 - -## 0.3.0 - -### Patch Changes - -- @graphql-yoga/node@2.3.0 - -## 0.2.1 - -### Patch Changes - -- Updated dependencies [32e2e40] - - @graphql-yoga/node@2.2.1 - -## 0.2.0 - -### Patch Changes - -- Updated dependencies [1d4fe42] - - @graphql-yoga/node@2.2.0 - -## 0.1.0 - -### Patch Changes - -- Updated dependencies [4077773] -- Updated dependencies [2739db2] -- Updated dependencies [cd9394e] - - @graphql-yoga/node@2.1.0 - -## 0.0.1 - -### Patch Changes - -- Updated dependencies [d414f95] -- Updated dependencies [133f8e9] -- Updated dependencies [14c93a7] -- Updated dependencies [ec777b1] -- Updated dependencies [dcaea56] -- Updated dependencies [b0b244b] -- Updated dependencies [cfec14b] -- Updated dependencies [433558f] -- Updated dependencies [3c82b57] -- Updated dependencies [f5f06f4] -- Updated dependencies [dcaea56] -- Updated dependencies [8ab60cf] -- Updated dependencies [433558f] -- Updated dependencies [5fba736] -- Updated dependencies [62e8c07] -- Updated dependencies [ce60a48] -- Updated dependencies [a8b619b] -- Updated dependencies [6d60ebf] -- Updated dependencies [44ad1b3] -- Updated dependencies [0424fe3] -- Updated dependencies [de1693e] -- Updated dependencies [d60f79f] -- Updated dependencies [dcaea56] -- Updated dependencies [daeea82] -- Updated dependencies [a10a16c] - - @graphql-yoga/node@0.1.0 - -## 0.0.1-beta.0 - -### Patch Changes - -- Updated dependencies [3c82b57] -- Updated dependencies [6d60ebf] -- Updated dependencies [0424fe3] -- Updated dependencies [d60f79f] - - @graphql-yoga/node@0.1.0-beta.8 diff --git a/examples/aws-lambda/lambda/graphql.ts b/examples/aws-lambda/lambda/graphql.ts deleted file mode 100644 index 51e06c9d7b..0000000000 --- a/examples/aws-lambda/lambda/graphql.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { APIGatewayEvent, APIGatewayProxyResult, Context } from 'aws-lambda'; -import { createSchema, createYoga } from 'graphql-yoga'; - -const yoga = createYoga<{ - event: APIGatewayEvent; - lambdaContext: Context; -}>({ - graphqlEndpoint: '/graphql', - landingPage: false, - schema: createSchema({ - typeDefs: /* GraphQL */ ` - type Query { - greetings: String - } - `, - resolvers: { - Query: { - greetings: () => 'This is the `greetings` field of the root `Query` type', - }, - }, - }), -}); - -export async function handler( - event: APIGatewayEvent, - lambdaContext: Context, -): Promise { - const response = await yoga.fetch( - event.path + - '?' + - new URLSearchParams((event.queryStringParameters as Record) || {}).toString(), - { - method: event.httpMethod, - headers: event.headers as HeadersInit, - body: event.body - ? Buffer.from(event.body, event.isBase64Encoded ? 'base64' : 'utf8') - : undefined, - }, - { - event, - lambdaContext, - }, - ); - - const responseHeaders = Object.fromEntries(response.headers.entries()); - - return { - statusCode: response.status, - headers: responseHeaders, - body: await response.text(), - isBase64Encoded: false, - }; -} diff --git a/examples/aws-lambda/lambda/package.json b/examples/aws-lambda/lambda/package.json deleted file mode 100644 index 2e711c8325..0000000000 --- a/examples/aws-lambda/lambda/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "graphql-lambda", - "version": "3.10.3", - "description": "", - "author": "", - "license": "ISC", - "private": true, - "main": "graphql.js", - "keywords": [], - "scripts": { - "check": "exit 0", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "graphql": "^16.3.0", - "graphql-yoga": "workspace:*" - } -} diff --git a/packages/graphql-yoga/__integration-tests__/browser.spec.ts b/packages/graphql-yoga/__integration-tests__/browser.spec.ts index 5a376c410f..969264e779 100644 --- a/packages/graphql-yoga/__integration-tests__/browser.spec.ts +++ b/packages/graphql-yoga/__integration-tests__/browser.spec.ts @@ -18,6 +18,7 @@ import { createServer, Server } from 'node:http'; import { AddressInfo } from 'node:net'; import { setTimeout as setTimeout$ } from 'node:timers/promises'; import puppeteer, { Browser, ElementHandle, Page } from 'puppeteer'; +import { fakePromise } from '@whatwg-node/server'; import { CORSOptions, createYoga, Repeater } from '../src/index.js'; let resolveOnReturn: VoidFunction; @@ -42,7 +43,7 @@ const fakeAsyncIterable = { return: () => { resolveOnReturn(); timeoutsSignal.abort(); - return Promise.resolve({ done: true }); + return fakePromise({ done: true }); }, }; diff --git a/packages/graphql-yoga/__integration-tests__/incremental-delivery.spec.ts b/packages/graphql-yoga/__integration-tests__/incremental-delivery.spec.ts index dfcbf27aab..fe6c71fa7e 100644 --- a/packages/graphql-yoga/__integration-tests__/incremental-delivery.spec.ts +++ b/packages/graphql-yoga/__integration-tests__/incremental-delivery.spec.ts @@ -10,6 +10,7 @@ import { } from 'graphql'; import { Push } from '@repeaterjs/repeater'; import { createFetch, fetch, File, FormData } from '@whatwg-node/fetch'; +import { fakePromise } from '@whatwg-node/server'; import { createSchema, createYoga, Plugin, Repeater } from '../src'; describe('incremental delivery', () => { @@ -23,26 +24,25 @@ describe('incremental delivery', () => { const fakeIterator: AsyncIterableIterator = { [Symbol.asyncIterator]: () => fakeIterator, - async next() { + next() { counter++; - await new Promise(resolve => setImmediate(resolve)); - return { + return fakePromise({ done: false, value: { data: { counter, }, }, - }; + }); }, return: jest.fn(() => { onIteratorDone(); - return Promise.resolve({ done: true, value: undefined }); + return fakePromise({ done: true, value: undefined }); }), }; const plugin: Plugin = { onExecute(ctx) { - ctx.setExecuteFn(() => Promise.resolve(fakeIterator) as unknown); + ctx.setExecuteFn(() => fakeIterator); }, /* skip validation :) */ onValidate(ctx) { diff --git a/packages/graphql-yoga/__integration-tests__/subscription.spec.ts b/packages/graphql-yoga/__integration-tests__/subscription.spec.ts index 363cb2eab8..941a0ef5f0 100644 --- a/packages/graphql-yoga/__integration-tests__/subscription.spec.ts +++ b/packages/graphql-yoga/__integration-tests__/subscription.spec.ts @@ -2,6 +2,7 @@ import { createServer } from 'node:http'; import { AddressInfo } from 'node:net'; import { ExecutionResult } from 'graphql'; import { fetch } from '@whatwg-node/fetch'; +import { fakePromise } from '@whatwg-node/server'; import { createSchema, createYoga } from '../src'; describe('subscription', () => { @@ -29,7 +30,7 @@ describe('subscription', () => { }, return: jest.fn(() => { onIteratorDone(); - return Promise.resolve({ done: true, value: undefined }); + return fakePromise({ done: true, value: undefined }); }), }; const yoga = createYoga({ diff --git a/packages/graphql-yoga/__tests__/accept-header.spec.ts b/packages/graphql-yoga/__tests__/accept-header.spec.ts index 4dca51dd14..fd3ce2ae24 100644 --- a/packages/graphql-yoga/__tests__/accept-header.spec.ts +++ b/packages/graphql-yoga/__tests__/accept-header.spec.ts @@ -1,4 +1,5 @@ import { ExecutionResult } from 'graphql'; +import { fakePromise } from '@whatwg-node/server'; import { createSchema, createYoga, Plugin, Repeater } from '../src/index.js'; describe('accept header', () => { @@ -166,7 +167,7 @@ describe('accept header', () => { const plugin: Plugin = { onExecute(args) { args.setExecuteFn(() => - Promise.resolve( + fakePromise( new Repeater((_push, end) => { end(); }), diff --git a/packages/graphql-yoga/__tests__/request-cancellation.spec.ts b/packages/graphql-yoga/__tests__/request-cancellation.spec.ts index 3d183ca489..3dcfbaf1d5 100644 --- a/packages/graphql-yoga/__tests__/request-cancellation.spec.ts +++ b/packages/graphql-yoga/__tests__/request-cancellation.spec.ts @@ -1,6 +1,6 @@ import { setTimeout as setTimeout$ } from 'node:timers/promises'; import { useDeferStream } from '@graphql-yoga/plugin-defer-stream'; -import { createDeferredPromise } from '@whatwg-node/server'; +import { createDeferredPromise, fakePromise } from '@whatwg-node/server'; import { createLogger, createSchema, createYoga, FetchAPI } from '../src/index'; import { useExecutionCancellation } from '../src/plugins/use-execution-cancellation'; @@ -59,7 +59,7 @@ describe.each(variants)('request cancellation (%s)', (_, fetchAPI) => { plugins: [useExecutionCancellation()], }); const abortController = new AbortController(); - const promise = Promise.resolve( + const promise = fakePromise( yoga.fetch('http://yoga/graphql', { method: 'POST', body: JSON.stringify({ query: '{ root { a } }' }), diff --git a/packages/graphql-yoga/__tests__/schema.spec.ts b/packages/graphql-yoga/__tests__/schema.spec.ts index 539f7b1eeb..c51196ddb1 100644 --- a/packages/graphql-yoga/__tests__/schema.spec.ts +++ b/packages/graphql-yoga/__tests__/schema.spec.ts @@ -1,4 +1,5 @@ import { GraphQLSchema } from 'graphql'; +import { fakePromise } from '@whatwg-node/server'; import { createSchema, createYoga } from '../src/index.js'; describe('schema', () => { @@ -110,7 +111,7 @@ describe('schema', () => { }); it('schema promise', async () => { - const schemaPromise = Promise.resolve( + const schemaPromise = fakePromise( createSchema({ typeDefs: /* GraphQL */ ` type Query { @@ -146,7 +147,7 @@ describe('schema', () => { }); it('fails if promise does not resolve to a schema', async () => { - const schemaPromise = Promise.resolve(null as unknown as GraphQLSchema); + const schemaPromise = fakePromise(null as unknown as GraphQLSchema); const yoga = createYoga({ schema: schemaPromise, maskedErrors: false, @@ -174,7 +175,7 @@ describe('schema', () => { it('schema factory returning a promise', async () => { const yoga = createYoga({ schema: () => - Promise.resolve( + fakePromise( createSchema({ typeDefs: /* GraphQL */ ` type Query { @@ -209,7 +210,7 @@ describe('schema', () => { it('fails if factory function returning a promise does not resolve to a schema', async () => { const yoga = createYoga({ - schema: () => Promise.resolve(null as unknown as GraphQLSchema), + schema: () => fakePromise(null as unknown as GraphQLSchema), maskedErrors: false, }); const query = /* GraphQL */ ` diff --git a/packages/graphql-yoga/__tests__/subscriptions.spec.ts b/packages/graphql-yoga/__tests__/subscriptions.spec.ts index 82408452b4..a5996fe6d0 100644 --- a/packages/graphql-yoga/__tests__/subscriptions.spec.ts +++ b/packages/graphql-yoga/__tests__/subscriptions.spec.ts @@ -1,5 +1,5 @@ import { GraphQLError } from 'graphql'; -import { createDeferredPromise } from '@whatwg-node/server'; +import { createDeferredPromise, fakePromise } from '@whatwg-node/server'; import { createSchema, createYoga, maskError, Plugin } from '../src/index.js'; import { eventStream } from './utilities.js'; @@ -151,7 +151,7 @@ data: next: () => d.promise.then(() => ({ done: true, value: undefined })), return: () => { d.resolve(); - return Promise.resolve({ done: true, value: undefined }); + return fakePromise({ done: true, value: undefined }); }, throw: () => { throw new Error('Method not implemented. (throw)'); diff --git a/packages/graphql-yoga/src/plugins/result-processor/multipart.ts b/packages/graphql-yoga/src/plugins/result-processor/multipart.ts index 8f72648531..5a55782795 100644 --- a/packages/graphql-yoga/src/plugins/result-processor/multipart.ts +++ b/packages/graphql-yoga/src/plugins/result-processor/multipart.ts @@ -1,5 +1,6 @@ import { ExecutionResult } from 'graphql'; import { isAsyncIterable } from '@envelop/core'; +import { fakePromise } from '@whatwg-node/server'; import { getResponseInitByRespectingErrors } from '../../error.js'; import { FetchAPI, MaybeArray } from '../../types.js'; import { ResultProcessorInput } from '../types.js'; @@ -27,10 +28,10 @@ export function processMultipartResult(result: ResultProcessorInput, fetchAPI: F iterator = { next: () => { if (finished) { - return Promise.resolve({ done: true, value: null }); + return fakePromise({ done: true, value: null }); } finished = true; - return Promise.resolve({ done: false, value: result }); + return fakePromise({ done: false, value: result }); }, }; } diff --git a/packages/graphql-yoga/src/plugins/result-processor/sse.ts b/packages/graphql-yoga/src/plugins/result-processor/sse.ts index b19ba3be02..cceff61d06 100644 --- a/packages/graphql-yoga/src/plugins/result-processor/sse.ts +++ b/packages/graphql-yoga/src/plugins/result-processor/sse.ts @@ -1,5 +1,6 @@ import { ExecutionResult } from 'graphql'; import { isAsyncIterable } from '@envelop/core'; +import { fakePromise } from '@whatwg-node/server'; import { getResponseInitByRespectingErrors } from '../../error.js'; import { FetchAPI, MaybeArray } from '../../types.js'; import { ResultProcessor, ResultProcessorInput } from '../types.js'; @@ -49,10 +50,10 @@ export function getSSEProcessor(): ResultProcessor { iterator = { next: () => { if (finished) { - return Promise.resolve({ done: true, value: null }); + return fakePromise({ done: true, value: null }); } finished = true; - return Promise.resolve({ done: false, value: result }); + return fakePromise({ done: false, value: result }); }, }; } diff --git a/packages/graphql-yoga/src/plugins/use-graphiql.spec.ts b/packages/graphql-yoga/src/plugins/use-graphiql.spec.ts index 4ed45ca0f2..54ec899e9f 100644 --- a/packages/graphql-yoga/src/plugins/use-graphiql.spec.ts +++ b/packages/graphql-yoga/src/plugins/use-graphiql.spec.ts @@ -1,10 +1,11 @@ +import { fakePromise } from '@whatwg-node/server'; import { createYoga } from '../server'; describe('GraphiQL', () => { describe('when received an option factory that returns Promise', () => { it('should respect graphiql option', async () => { const yoga = createYoga({ - graphiql: () => Promise.resolve({ title: 'Test GraphiQL' }), + graphiql: () => fakePromise({ title: 'Test GraphiQL' }), }); const response = await yoga.fetch('http://localhost:3000/graphql', { method: 'GET', @@ -19,7 +20,7 @@ describe('GraphiQL', () => { it('returns error when graphiql is disabled', async () => { const yoga = createYoga({ - graphiql: () => Promise.resolve(false), + graphiql: () => fakePromise(false), }); const response = await yoga.fetch('http://localhost:3000/graphql', { method: 'GET', @@ -33,7 +34,7 @@ describe('GraphiQL', () => { it('returns graphiql when passing query params and trailing slash', async () => { const yoga = createYoga({ - graphiql: () => Promise.resolve({ title: 'Test GraphiQL' }), + graphiql: () => fakePromise({ title: 'Test GraphiQL' }), }); const responseWithQueryParams = await yoga.fetch( 'http://localhost:3000/graphql?query=something+awesome', diff --git a/packages/plugins/apollo-inline-trace/__tests__/fixtures/getStitchedSchemaFromLocalSchemas.ts b/packages/plugins/apollo-inline-trace/__tests__/fixtures/getStitchedSchemaFromLocalSchemas.ts index a992d8d088..05ff77c2c4 100644 --- a/packages/plugins/apollo-inline-trace/__tests__/fixtures/getStitchedSchemaFromLocalSchemas.ts +++ b/packages/plugins/apollo-inline-trace/__tests__/fixtures/getStitchedSchemaFromLocalSchemas.ts @@ -2,6 +2,7 @@ import { GraphQLSchema } from 'graphql'; import { createDefaultExecutor } from '@graphql-tools/delegate'; import { getStitchedSchemaFromSupergraphSdl } from '@graphql-tools/federation'; +import { fakePromise } from '@whatwg-node/server'; export async function getStitchedSchemaFromLocalSchemas( localSchemas: Record, @@ -11,7 +12,7 @@ export async function getStitchedSchemaFromLocalSchemas( const introspectAndCompose = await new IntrospectAndCompose({ subgraphs: Object.keys(localSchemas).map(name => ({ name, url: `http://localhost/${name}` })), }).initialize({ - healthCheck: async () => Promise.resolve(), + healthCheck: () => fakePromise(), update: () => undefined, getDataSource: ({ name }) => { const [_name, schema] = Object.entries(localSchemas).find(([key]) => key === name) ?? []; diff --git a/packages/plugins/apollo-managed-federation/test/apollo-managed-federation.spec.ts b/packages/plugins/apollo-managed-federation/test/apollo-managed-federation.spec.ts index aabee418da..1f2e4b18a1 100644 --- a/packages/plugins/apollo-managed-federation/test/apollo-managed-federation.spec.ts +++ b/packages/plugins/apollo-managed-federation/test/apollo-managed-federation.spec.ts @@ -3,6 +3,7 @@ import { createYoga } from 'graphql-yoga'; import { SupergraphSchemaManager, SupergraphSchemaManagerOptions } from '@graphql-tools/federation'; import { useManagedFederation } from '@graphql-yoga/plugin-apollo-managed-federation'; import { Response } from '@whatwg-node/fetch'; +import { fakePromise } from '@whatwg-node/server'; import { supergraphSdl } from './fixtures/supergraph'; describe('Apollo Managed Federation', () => { @@ -150,7 +151,7 @@ describe('Apollo Managed Federation', () => { }); const mockSDL = () => - Promise.resolve( + fakePromise( Response.json({ data: { routerConfig: { diff --git a/packages/plugins/defer-stream/__integration-tests__/defer-stream.spec.ts b/packages/plugins/defer-stream/__integration-tests__/defer-stream.spec.ts index 6e3bc416ce..0aa142f56e 100644 --- a/packages/plugins/defer-stream/__integration-tests__/defer-stream.spec.ts +++ b/packages/plugins/defer-stream/__integration-tests__/defer-stream.spec.ts @@ -4,7 +4,7 @@ import { setTimeout as setTimeout$ } from 'node:timers/promises'; import fetchMultipart from 'fetch-multipart-graphql'; import { createLogger, createSchema, createYoga, useExecutionCancellation } from 'graphql-yoga'; import { useDeferStream } from '@graphql-yoga/plugin-defer-stream'; -import { createDeferredPromise } from '@whatwg-node/server'; +import { createDeferredPromise, fakePromise } from '@whatwg-node/server'; import { createPushPullAsyncIterable } from '../__tests__/push-pull-async-iterable.js'; it('correctly deals with the source upon aborted requests', async () => { @@ -108,7 +108,7 @@ it('memory/cleanup leak by source that never publishes a value', async () => { }, return() { sourceGotCleanedUp = true; - return Promise.resolve({ done: true, value: undefined }); + return fakePromise({ done: true, value: undefined }); }, }; diff --git a/packages/plugins/defer-stream/__tests__/push-pull-async-iterable.ts b/packages/plugins/defer-stream/__tests__/push-pull-async-iterable.ts index 103345c61c..4259301882 100644 --- a/packages/plugins/defer-stream/__tests__/push-pull-async-iterable.ts +++ b/packages/plugins/defer-stream/__tests__/push-pull-async-iterable.ts @@ -1,4 +1,5 @@ import { Repeater } from 'graphql-yoga'; +// eslint-disable-next-line import/no-extraneous-dependencies import { createDeferredPromise } from '@whatwg-node/server'; export const createPushPullAsyncIterable = (): { diff --git a/packages/subscription/src/operator/filter.spec.ts b/packages/subscription/src/operator/filter.spec.ts index 0eb28e8531..0bbe22010e 100644 --- a/packages/subscription/src/operator/filter.spec.ts +++ b/packages/subscription/src/operator/filter.spec.ts @@ -1,3 +1,4 @@ +import { fakePromise } from '@whatwg-node/server'; import { filter } from './filter.js'; async function collectAsyncIterableValues( @@ -34,7 +35,7 @@ describe('filter', () => { yield 1; } - const filterFn = (value: number) => Promise.resolve(value < 3); + const filterFn = (value: number) => fakePromise(value < 3); const stream = filter(filterFn)(source()); const result = await collectAsyncIterableValues(stream); diff --git a/website/src/pages/docs/features/persisted-operations.mdx b/website/src/pages/docs/features/persisted-operations.mdx index eedcb74c54..940a81fab5 100644 --- a/website/src/pages/docs/features/persisted-operations.mdx +++ b/website/src/pages/docs/features/persisted-operations.mdx @@ -171,7 +171,7 @@ const client = new createClient({ persistedExchange({ enforcePersistedQueries: true, enableForMutation: true, - generateHash: (_, document) => Promise.resolve(document['__meta__']['hash']) + generateHash: async (_, document) => document['__meta__']['hash'] }) ] })