You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Require legacy incremental execute as an ApolloServer option instead of a dynamic import (#8161)
Fixes#8159
Dynamically importing `@yaacovcr/transform` if available has proven to
be a difficult solution because some bundlers fail to build when the
package isn't installed.
This PR addresses this issue by making the legacy execute function an
option that can be provided to the `ApolloServer` constructor. This
means no direct dependency on `@yaacovcr/transform` and makes it
possible to use other legacy execution functions if available.
To migrate, import the `legacyExecuteIncrementally` and provide it as
the `legacyExperimentalExecuteIncrementally` option to the
`ApolloServer` constructor.
```ts
import { legacyExecuteIncrementally } from '@yaacovcr/transform';
const server = new ApolloServer({
// ...
legacyExperimentalExecuteIncrementally: legacyExecuteIncrementally
})
```
Fix an issue where some bundlers would fail to build because of the dynamic import for the optional peer dependency on `@yaacovcr/transform` introduced in `@apollo/server` 5.1.0. To provide support for the legacy incremental format, you must now provide the `legacyExperimentalExecuteIncrementally` option to the `ApolloServer` constructor.
If the `legacyExperimentalExecuteIncrementally` option is not provided and the client sends an `Accept` header with a value of `multipart/mixed; deferSpec=20220824`, an error is returned by the server.
Copy file name to clipboardExpand all lines: docs/source/workflow/requests.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ Apollo Server 5.1 changed the required pre-release `graphql` version from `17.0.
131
131
132
132
</Note>
133
133
134
-
<MinVersionversion="5.1.0">
134
+
<MinVersionversion="5.2.0">
135
135
136
136
### Add support for the legacy incremental delivery protocol
137
137
@@ -145,4 +145,13 @@ You may choose to support the legacy incremental delivery protocol by installing
145
145
npm install @yaacovcr/transform
146
146
```
147
147
148
-
There is nothing else to configure. Apollo Server will load the necessary utility if this package is installed.
148
+
You will then need to configure Apollo Server with the `legacyExperimentalExecuteIncrementally` option in order to provide support for the legacy incremental format.
0 commit comments