|
1 | 1 | # @apollo/server |
2 | 2 |
|
| 3 | +## 5.1.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#8148](https://github.com/apollographql/apollo-server/pull/8148) [`80a1a1a`](https://github.com/apollographql/apollo-server/commit/80a1a1af12b326d8c0f900bd85a25e14ee9cd9c0) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Apollo Server now supports the incremental delivery protocol ( `@defer` and `@stream`) that ships with `[email protected]`. To use the current protocol, clients must send the `Accept` header with a value of `multipart/mixed; incrementalSpec=v0.2`. |
| 8 | + |
| 9 | + Upgrading to 5.1 will depend on what version of `graphql` you have installed and whether you already support the incremental delivery protocol. |
| 10 | + |
| 11 | + ## I use `graphql@16` without incremental delivery |
| 12 | + |
| 13 | + Continue using `graphql` v16 with no additional changes. Incremental delivery won't be available. |
| 14 | + |
| 15 | + ## I use `graphql@16` but would like to add support for incremental delivery |
| 16 | + |
| 17 | + Install `[email protected]` and follow the ["Incremental delivery" guide ](https://www.apollographql.com/docs/apollo-server/workflow/requests#incremental-delivery-experimental) to add the `@defer` and `@stream` directives to your schema. Clients should send the `Accept` header with a value of `multipart/mixed; incrementalSpec=v0.2` to get multipart responses. |
| 18 | + |
| 19 | + ## I use `[email protected]` and use incremental delivery |
| 20 | + |
| 21 | + You must upgrade to `[email protected]` to continue using incremental delivery. If you'd like to continue providing support for the legacy incremental protocol, install the [`@yaacovcr/transform`](https://github.com/yaacovCR/transform) package. Apollo Server will attempt to load this module when the client specifies an `Accept` header with a value of `multipart/mixed; deferSpec=20220824`. If this package is not installed, an error is returned by the server. |
| 22 | + |
| 23 | + Because Apollo Server now supports multiple versions of the incremental delivery types, the existing incremental delivery types have been renamed with an `Alpha2` suffix. If you import these types in your code, you will need to add the `Alpha2` suffix. |
| 24 | + |
| 25 | + ```diff |
| 26 | + import type { |
| 27 | + - GraphQLExperimentalFormattedInitialIncrementalExecutionResult, |
| 28 | + + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha2, |
| 29 | + |
| 30 | + - GraphQLExperimentalFormattedSubsequentIncrementalExecutionResult, |
| 31 | + + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha2, |
| 32 | + |
| 33 | + - GraphQLExperimentalFormattedIncrementalResult, |
| 34 | + + GraphQLExperimentalFormattedIncrementalResultAlpha2, |
| 35 | + |
| 36 | + - GraphQLExperimentalFormattedIncrementalDeferResult, |
| 37 | + + GraphQLExperimentalFormattedIncrementalDeferResultAlpha2, |
| 38 | + |
| 39 | + - GraphQLExperimentalFormattedIncrementalStreamResult, |
| 40 | + + GraphQLExperimentalFormattedIncrementalStreamResultAlpha2, |
| 41 | + } from '@apollo/server'; |
| 42 | + ``` |
| 43 | + |
| 44 | + Incremental delivery types for the `[email protected]` version are now available using the `Alpha9` suffix: |
| 45 | + |
| 46 | + ```ts |
| 47 | + import type { |
| 48 | + GraphQLExperimentalFormattedInitialIncrementalExecutionResultAlpha9, |
| 49 | + GraphQLExperimentalFormattedSubsequentIncrementalExecutionResultAlpha9, |
| 50 | + GraphQLExperimentalFormattedIncrementalResultAlpha9, |
| 51 | + GraphQLExperimentalFormattedIncrementalDeferResultAlpha9, |
| 52 | + GraphQLExperimentalFormattedIncrementalStreamResultAlpha9, |
| 53 | + GraphQLExperimentalFormattedCompletedResultAlpha9, |
| 54 | + GraphQLExperimentalPendingResultAlpha9, |
| 55 | + } from '@apollo/server'; |
| 56 | + ``` |
| 57 | + |
3 | 58 | ## 5.1.0-rc.0 |
4 | 59 |
|
5 | 60 | ### Minor Changes |
|
0 commit comments