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