File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
website/pages/upgrade-guides Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,26 @@ import { Callout } from 'nextra/components'
1212
1313# Breaking changes
1414
15+ ## ESM only
16+
17+ GraphQL.js is now an ESM only library, for CJS builds use GraphQL v16 instead. This decision was made in light
18+ of ` require(esm) ` becoming a mainline feature in Node.js 20. This removes the dual package hazard from GraphQL.JS as
19+ we stop publishing two distinct versions for CJS and ESM.
20+
21+ ## ` setEnv `
22+
23+ We've removed the ` process.env ` check in favor of a more explicit ` setEnv ` function. By default we'll assume
24+ we are in ` production ` mode, if you need to run in ` development ` mode you can do so by calling ` setEnv('development') ` .
25+
26+ The main check that gets added is the ` instanceOf ` check, this is used to determine if a value is an instance of
27+ a given type but originates from a different version of the library.
28+
29+ ``` ts
30+ import { setEnv } from ' graphql' ;
31+
32+ setEnv (' development' );
33+ ```
34+
1535## Default values
1636
1737GraphQL schemas allow default values for input fields and arguments. Historically, GraphQL.js did not rigorously validate or coerce these
You can’t perform that action at this time.
0 commit comments