File tree Expand file tree Collapse file tree 4 files changed +19
-8
lines changed Expand file tree Collapse file tree 4 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 43
43
- run : npm run test:ci
44
44
- store_test_results :
45
45
path : junit.xml
46
+ Incremental Delivery :
47
+ docker :
48
+ - image : cimg/base:stable
49
+ environment :
50
+ INCREMENTAL_DELIVERY_TESTS_ENABLED : t
51
+ steps :
52
+ - setup-node :
53
+ node-version : " 18"
54
+ # Install a prerelease of graphql-js 17 with incremental delivery support.
55
+ # --legacy-peer-deps because nothing expects v17 yet.
56
+ - run : npm i --legacy-peer-deps graphql@17.0.0-alpha.1.canary.pr.3361.04ab27334641e170ce0e05bc927b972991953882
57
+ - run : npm run test:ci
46
58
Lint :
47
59
docker :
48
60
- image : cimg/base:stable
@@ -69,3 +81,4 @@ workflows:
69
81
- " 16"
70
82
- " 18"
71
83
- " 20"
84
+ - Incremental Delivery
Original file line number Diff line number Diff line change
1
+ import { Readable } from "node:stream" ;
2
+
1
3
import { ApolloServer , BaseContext } from "@apollo/server" ;
2
4
import type { WithRequired } from "@apollo/utils.withrequired" ;
3
5
import type {
@@ -114,8 +116,10 @@ export function fastifyApolloHandler<
114
116
115
117
if ( body . kind === "complete" ) {
116
118
return body . string ;
117
- } else {
118
- throw new Error ( "Incremental delivery not implemented yet." ) ;
119
119
}
120
+
121
+ const readable = Readable . from ( body . asyncIterator ) ;
122
+ // @ts -ignore something wrong with the `ReplyType` but not sure what
123
+ return reply . send ( readable ) ;
120
124
} ;
121
125
}
Original file line number Diff line number Diff line change @@ -34,7 +34,4 @@ defineIntegrationTestSuite(
34
34
url,
35
35
} ;
36
36
} ,
37
- {
38
- noIncrementalDelivery : true ,
39
- } ,
40
37
) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,4 @@ defineIntegrationTestSuite(
34
34
url,
35
35
} ;
36
36
} ,
37
- {
38
- noIncrementalDelivery : true ,
39
- } ,
40
37
) ;
You can’t perform that action at this time.
0 commit comments