Directives
This is the documentation of the GraphQL Library version 6. For the long-term support (LTS) version 5, refer to GraphQL Library version 5 LTS. |
The Neo4j GraphQL Library provides the following directives to be used whilst defining types:
Security
Directive | Description |
---|---|
Requires authentication checks when accessing the type. |
|
Specifies authorization rules for queries and mutations on the type. |
|
Configures the JWT authentication and authorization filters to include additional JWT claims. |
|
Used in combination with |
|
Specifies authorization rules for subscriptions on the type. |
Database mapping
Directive | Description |
---|---|
Specifies the configuration of a GraphQL object type which represents a Neo4j node. |
|
Configures relationships between object types. Also see |
|
Required to differentiate interfaces that are used for relationship properties, and otherwise. |
|
Maps a GraphQL schema field to a Neo4j property on a node or relationship. |
|
Configure relationships to be implemented on object types. |
Autogeneration
Directive | Description |
---|---|
Marks a field as the unique ID for an object type, and allows for autogeneration of IDs. |
|
Flags fields to be used to store timestamps on |
Schema configuration
Directive | Description |
---|---|
Limits the availability of query operations in the library. |
|
Limits the availability of Mutation operations in the library. |
|
Limits subscription operations in the library. |
|
Allows the setting of a default value for a field during object creation. |
|
Redefines how to compose the plural of the type for the generated operations. Particularly useful for types that are not correctly pluralized or are non-English words. |
|
Sets the availability of fields on queries and aggregations. |
|
Sets the availability of fields on the |
|
Defines the filters generated for a field. |
Indexes and constraints
Directive | Description |
---|---|
Indicates that there should be a fulltext index inserted into the database for the specified Node and its properties. |
|
Indicates that there should be a uniqueness constraint in the database for the fields that it is applied to. |
|
Perform a vector index search on your database either based by passing in a vector index or a search phrase. |
Custom logic
Directive | Description |
---|---|
Overrides field resolution (including query and mutation fields), instead resolving with the specified Cypher. |
|
Exposes a mechanism for querying against non-existent, |
|
Used on nodes to inject values into Cypher |
|
Specifies that a field is resolved by a custom resolver, and allows the specification of any required fields that is passed as arguments to the custom resolver. |
|
Specifies a callback function (executed during GraphQL query parsing) to populate fields which have not been provided within the input. |