Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
86 changes: 86 additions & 0 deletions modules/ROOT/pages/neo4jgraphql-class.adoc
Original file line number Diff line number Diff line change
@@ -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`].