From 558315ee7d6a364af29b8a135939bd46c9afd72e Mon Sep 17 00:00:00 2001 From: angrykoala Date: Mon, 13 May 2024 15:06:00 +0100 Subject: [PATCH 1/2] Add optimization page --- modules/ROOT/content-nav.adoc | 1 + modules/ROOT/pages/optimization.adoc | 35 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 modules/ROOT/pages/optimization.adoc 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..4475fce2 --- /dev/null +++ b/modules/ROOT/pages/optimization.adoc @@ -0,0 +1,35 @@ +[[optimization]] += Optimization + + +This chapter contains some optimizations to improve the performance of a production system using `@neo4j/graphql`. + +== Schema Optimisations +This section covers improvements to reduce the size of the generated schema. Reducing the schema size has the following performance benefits: + +* Reduce the startup time of the server. +* 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 generation for these 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, + }, + }, +}); +``` + From bcfc9508148bc2fb735cc59a20ebe15c84f3b451 Mon Sep 17 00:00:00 2001 From: angrykoala Date: Mon, 13 May 2024 16:36:45 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Richard Sill <156673635+rsill-neo4j@users.noreply.github.com> --- modules/ROOT/pages/optimization.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/optimization.adoc b/modules/ROOT/pages/optimization.adoc index 4475fce2..aaacde38 100644 --- a/modules/ROOT/pages/optimization.adoc +++ b/modules/ROOT/pages/optimization.adoc @@ -2,18 +2,18 @@ = Optimization -This chapter contains some optimizations to improve the performance of a production system using `@neo4j/graphql`. +This page contains optimizations to improve the performance of a production system using `@neo4j/graphql`. -== Schema Optimisations -This section covers improvements to reduce the size of the generated schema. Reducing the schema size has the following performance benefits: +== Schema optimizations +This section covers optimizations to reduce the size of the generated schema. Reducing the schema size has the following performance benefits: -* Reduce the startup time of the server. +* 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 generation for these with the `excludeDeprecatedFields` flag in the library setup. +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: