Neo4jGraphQL
类
这是 GraphQL 库版本 7 的文档。对于长期支持 (LTS) 版本 5,请参考GraphQL 库版本 5 LTS。 |
您可以在 Neo4jGraphQL 构造函数中分配不同的设置字段
export interface Neo4jGraphQLConstructor {
typeDefs: TypeDefinitions; (1)
resolvers?: IExecutableSchemaDefinition["resolvers"]; (2)
features?: Neo4jFeaturesSettings; (3)
driver?: Driver; (4)
debug?: boolean;
validate?: boolean;
}
功能设置
您可以在 Neo4j GraphQL 构造函数的 features
字段中设置不同的功能。Neo4jFeaturesSettings
类型如下所示
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?: {
mutationOperations?: boolean;
aggregationFilters?: boolean;
aggregationFiltersOutsideConnection?: boolean;
relationshipFilters?: boolean;
attributeFilters?: boolean;
};
vector?: Neo4jVectorSettings;
};
populatedBy
设置
使用 populatedBy
字段注册 @populatedBy
指令使用的回调函数。请参阅@populatedBy
。
授权设置
在 authorization
字段中设置授权密钥。请参阅安全 > 配置。
订阅设置
通过将 subscriptions
功能设置为 true
来启用 Neo4j GraphQL 库的订阅功能。它也用于提供订阅设置。请参阅订阅引擎。
排除弃用字段
如果您不使用它们,请使用 excludeDeprecatedFields
来禁用各种弃用字段的生成。请参阅排除 @deprecated
字段。
向量设置
使用 vector
字段设置您的生成式 AI 提供商凭据。请参阅@vector
。