Skip to content

frontport v16 work to main #4301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix going to production
  • Loading branch information
JoviDeCroock authored and yaacovCR committed Jan 14, 2025
commit c4d58703db6459c5778b3c158d7778592ba979b9
36 changes: 0 additions & 36 deletions website/pages/going-to-production.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down