diff --git a/modules/ROOT/content-nav.adoc b/modules/ROOT/content-nav.adoc index b21fd9f3..26e1b68d 100644 --- a/modules/ROOT/content-nav.adoc +++ b/modules/ROOT/content-nav.adoc @@ -83,4 +83,5 @@ * xref:migration/index.adoc[Migration guide] * xref:deprecations.adoc[Deprecations] +* xref:optimization.adoc[] * xref:troubleshooting.adoc[] diff --git a/modules/ROOT/pages/optimization.adoc b/modules/ROOT/pages/optimization.adoc new file mode 100644 index 00000000..aaacde38 --- /dev/null +++ b/modules/ROOT/pages/optimization.adoc @@ -0,0 +1,35 @@ +[[optimization]] += Optimization + + +This page contains optimizations to improve the performance of a production system using `@neo4j/graphql`. + +== Schema optimizations +This section covers optimizations to reduce the size of the generated schema. Reducing the schema size has the following performance benefits: + +* Reduce server startup time. +* Reduce memory footprint. + +=== Exclude `@deprecated` fields +The `@neo4j/graphql` library generates some GraphQL fields and operations marked as `@deprecated`. These exists to keep compatibility with previous versions of the library. + +If you are not using these deprecated fields, you can disable their generation with the `excludeDeprecatedFields` flag in the library setup. + +The following example disables all deprecated fields that are generated in the library: + +```js +const neoSchema = new Neo4jGraphQL({ + typeDefs, + driver, + features: { + excludeDeprecatedFields: { + bookmark: true, + negationFilters: true, + arrayFilters: true, + stringAggregation: true, + aggregationFilters: true, + }, + }, +}); +``` +