Skip to content

Commit 9074c11

Browse files
authored
Merge pull request #240 from neo4j/constructor-features
constructor features
2 parents d37a175 + 1b03e86 commit 9074c11

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
** xref:types/interfaces.adoc[Interfaces]
2121
** xref:types/unions.adoc[Union]
2222
** xref:types/relationships.adoc[]
23+
* xref:neo4jgraphql-class.adoc[]
2324
* xref:directives/index.adoc[]
2425
** xref:directives/database-mapping.adoc[]
25-
2626
** xref:directives/autogeneration.adoc[]
2727
** xref:directives/schema-configuration/index.adoc[]
2828
*** xref:directives/schema-configuration/global-configuration.adoc[]
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
= The `Neo4jGraphQL` class
2+
:description: This section describes various setting field in the Neo4j GraphQL main class.
3+
4+
You can assign different setting fields in the Neo4jGraphQL constructor:
5+
6+
[source, javascript, indent=0]
7+
----
8+
export interface Neo4jGraphQLConstructor {
9+
typeDefs: TypeDefinitions; <1>
10+
resolvers?: IExecutableSchemaDefinition["resolvers"]; <2>
11+
features?: Neo4jFeaturesSettings; <3>
12+
driver?: Driver; <4>
13+
debug?: boolean;
14+
validate?: boolean;
15+
}
16+
----
17+
<1> See xref:types/index.adoc[].
18+
<2> See xref:directives/custom-logic.adoc#_customresolver[Custom resolvers].
19+
<3> See xref:#_feature_settings[] on this page.
20+
<4> See xref:driver-configuration.adoc[].
21+
22+
23+
== Feature settings
24+
25+
You can set different features in the `features` field of the Neo4j GraphQL constructor.
26+
The `Neo4jFeaturesSettings` type looks like this:
27+
28+
[source, javascript, indent=0]
29+
----
30+
export type Neo4jFeaturesSettings = {
31+
filters?: Neo4jFiltersSettings;
32+
populatedBy?: Neo4jPopulatedBySettings;
33+
authorization?: Neo4jAuthorizationSettings;
34+
subscriptions?: Neo4jGraphQLSubscriptionsEngine | boolean;
35+
/** If set to `true`, removes `@neo4j/graphql` fields that are marked as deprecated to reduce schema size.
36+
*
37+
* NOTE: this will not remove user defined deprecated fields
38+
**/
39+
excludeDeprecatedFields?: {
40+
bookmark?: boolean;
41+
negationFilters?: boolean;
42+
arrayFilters?: boolean;
43+
stringAggregation?: boolean;
44+
aggregationFilters?: boolean;
45+
nestedUpdateOperationsFields?: boolean;
46+
};
47+
vector?: Neo4jVectorSettings;
48+
};
49+
----
50+
51+
52+
=== Filter settings
53+
54+
Use `Neo4jFiltersSettings` to enable numeric String comparisons and regular expression filters for Strings and IDs.
55+
They are disabled by default.
56+
See xref:queries-aggregations/filtering.adoc#_string_comparison[String comparison] and xref:queries-aggregations/filtering.adoc#_regex_matching[RegEx matching].
57+
58+
59+
=== `populatedBy` settings
60+
61+
Use the `populatedBy` field to register callback functions used by the `@populatedBy` directive.
62+
See xref:directives/custom-logic.adoc#_populatedby[`@populatedBy`].
63+
64+
65+
=== Authorization settings
66+
67+
Set authorization keys in the `authorization` field.
68+
See xref:security/configuration.adoc[Security > Configuration].
69+
70+
71+
=== Subscription settings
72+
73+
Enable the `subscriptions` feature of the Neo4j GraphQL Library by setting it to `true`.
74+
See xref:subscriptions/engines.adoc[Subscription engines].
75+
76+
77+
=== Exclude deprecated fields
78+
79+
If you are not using them, use `excludeDeprecatedFields` to disable the generation of various deprecated fields.
80+
See xref:optimization.adoc#_exclude_deprecated_fields[Exclude `@deprecated` fields].
81+
82+
83+
=== Vector settings
84+
85+
Set your GenAI provider credentials with the `vector` field.
86+
See xref:directives/indexes-and-constraints.adoc#_vector_index_search[`@vector`].

0 commit comments

Comments
 (0)