diff --git a/modules/ROOT/content-nav.adoc b/modules/ROOT/content-nav.adoc index 4017db48..200a6509 100644 --- a/modules/ROOT/content-nav.adoc +++ b/modules/ROOT/content-nav.adoc @@ -20,9 +20,9 @@ ** xref:types/interfaces.adoc[Interfaces] ** xref:types/unions.adoc[Union] ** xref:types/relationships.adoc[] +* xref:neo4jgraphql-class.adoc[] * xref:directives/index.adoc[] ** xref:directives/database-mapping.adoc[] - ** xref:directives/autogeneration.adoc[] ** xref:directives/schema-configuration/index.adoc[] *** xref:directives/schema-configuration/global-configuration.adoc[] diff --git a/modules/ROOT/pages/neo4jgraphql-class.adoc b/modules/ROOT/pages/neo4jgraphql-class.adoc new file mode 100644 index 00000000..6c5afa20 --- /dev/null +++ b/modules/ROOT/pages/neo4jgraphql-class.adoc @@ -0,0 +1,86 @@ += The `Neo4jGraphQL` class +:description: This section describes various setting field in the Neo4j GraphQL main class. + +You can assign different setting fields in the Neo4jGraphQL constructor: + +[source, javascript, indent=0] +---- +export interface Neo4jGraphQLConstructor { + typeDefs: TypeDefinitions; <1> + resolvers?: IExecutableSchemaDefinition["resolvers"]; <2> + features?: Neo4jFeaturesSettings; <3> + driver?: Driver; <4> + debug?: boolean; + validate?: boolean; +} +---- +<1> See xref:types/index.adoc[]. +<2> See xref:directives/custom-logic.adoc#_customresolver[Custom resolvers]. +<3> See xref:#_feature_settings[] on this page. +<4> See xref:driver-configuration.adoc[]. + + +== Feature settings + +You can set different features in the `features` field of the Neo4j GraphQL constructor. +The `Neo4jFeaturesSettings` type looks like this: + +[source, javascript, indent=0] +---- +export type Neo4jFeaturesSettings = { + filters?: Neo4jFiltersSettings; + populatedBy?: Neo4jPopulatedBySettings; + authorization?: Neo4jAuthorizationSettings; + subscriptions?: Neo4jGraphQLSubscriptionsEngine | boolean; + /** If set to `true`, removes `@neo4j/graphql` fields that are marked as deprecated to reduce schema size. + * + * NOTE: this will not remove user defined deprecated fields + **/ + excludeDeprecatedFields?: { + bookmark?: boolean; + negationFilters?: boolean; + arrayFilters?: boolean; + stringAggregation?: boolean; + aggregationFilters?: boolean; + nestedUpdateOperationsFields?: boolean; + }; + vector?: Neo4jVectorSettings; +}; +---- + + +=== Filter settings + +Use `Neo4jFiltersSettings` to enable numeric String comparisons and regular expression filters for Strings and IDs. +They are disabled by default. +See xref:queries-aggregations/filtering.adoc#_string_comparison[String comparison] and xref:queries-aggregations/filtering.adoc#_regex_matching[RegEx matching]. + + +=== `populatedBy` settings + +Use the `populatedBy` field to register callback functions used by the `@populatedBy` directive. +See xref:directives/custom-logic.adoc#_populatedby[`@populatedBy`]. + + +=== Authorization settings + +Set authorization keys in the `authorization` field. +See xref:security/configuration.adoc[Security > Configuration]. + + +=== Subscription settings + +Enable the `subscriptions` feature of the Neo4j GraphQL Library by setting it to `true`. +See xref:subscriptions/engines.adoc[Subscription engines]. + + +=== Exclude deprecated fields + +If you are not using them, use `excludeDeprecatedFields` to disable the generation of various deprecated fields. +See xref:optimization.adoc#_exclude_deprecated_fields[Exclude `@deprecated` fields]. + + +=== Vector settings + +Set your GenAI provider credentials with the `vector` field. +See xref:directives/indexes-and-constraints.adoc#_vector_index_search[`@vector`]. \ No newline at end of file