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;
}
1 请参阅类型
2 请参阅自定义解析器
3 请参阅本页面上的功能设置
4 请参阅驱动程序配置

功能设置

您可以在 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;
};

筛选设置

使用 Neo4jFiltersSettings 可启用数字字符串比较以及字符串和 ID 的正则表达式筛选。它们默认禁用。请参阅字符串比较正则表达式匹配

populatedBy 设置

使用 populatedBy 字段注册 @populatedBy 指令使用的回调函数。请参阅@populatedBy

授权设置

authorization 字段中设置授权密钥。请参阅安全 > 配置

订阅设置

通过将 subscriptions 功能设置为 true 来启用 Neo4j GraphQL 库的订阅功能。它也用于提供订阅设置。请参阅订阅引擎

排除弃用字段

如果您不使用它们,请使用 excludeDeprecatedFields 来禁用各种弃用字段的生成。请参阅排除 @deprecated 字段

向量设置

使用 vector 字段设置您的生成式 AI 提供商凭据。请参阅@vector

© . All rights reserved.