From 16b3d01c7aa9f79a0e865407b5d8b2db62b13c99 Mon Sep 17 00:00:00 2001 From: jdecroock Date: Mon, 28 Oct 2024 09:53:13 +0100 Subject: [PATCH] Fix going to production --- website/pages/going-to-production.mdx | 36 --------------------------- 1 file changed, 36 deletions(-) diff --git a/website/pages/going-to-production.mdx b/website/pages/going-to-production.mdx index 000c6842e4..862932fb10 100644 --- a/website/pages/going-to-production.mdx +++ b/website/pages/going-to-production.mdx @@ -2,42 +2,6 @@ title: Going to Production --- -The `@defer` and `@stream` directives are not enabled by default. In order to use these directives, you must add them to your GraphQL Schema and use the `experimentalExecuteIncrementally` function instead of `execute`. - -```js -import { - GraphQLSchema, - GraphQLDeferDirective, - GraphQLStreamDirective, - specifiedDirectives, -} from 'graphql'; - -const schema = new GraphQLSchema({ - query, - directives: [ - ...specifiedDirectives, - GraphQLDeferDirective, - GraphQLStreamDirective, - ], -}); - -const result = experimentalExecuteIncrementally({ - schema, - document, -}); -``` - -If the `directives` option is passed to `GraphQLSchema`, the default directives will not be included. `specifiedDirectives` must be passed to ensure all standard directives are added in addition to `defer` & `stream`. -126 changes: 126 additions & 0 deletions126 -src/pages/graphql-js/going-to-production.mdx -Viewed -Original file line number Diff line number Diff line change -@@ -0,0 +1,126 @@ - ---- - -## title: Going to Production - GraphQL.JS contains a few development checks which in production will cause slower performance and an increase in bundle-size. Every bundler goes about these changes different, in here we'll list out the most popular ones.