Class AbstractKnexJsDAO<T>

Type Parameters

Hierarchy

Accessors

  • get info(): {
        idField: T["idFields"];
        name: T["entity"];
        schema: Readonly<{
            [key: string]: SchemaField<Scalars>;
        }>;
    }
  • Returns {
        idField: T["idFields"];
        name: T["entity"];
        schema: Readonly<{
            [key: string]: SchemaField<Scalars>;
        }>;
    }

    • idField: T["idFields"]
    • name: T["entity"]
    • schema: Readonly<{
          [key: string]: SchemaField<Scalars>;
      }>
  • get resolvers(): {
        create: ((params: InsertParams<T>, info: GraphQLResolveInfo) => Promise<PartialDeep<T["model"], {}>>);
        delete: ((params: Record<string, Record<string, unknown>>) => Promise<boolean>);
        read: ((params: Record<string, unknown>, info: GraphQLResolveInfo) => Promise<PartialDeep<T["model"], {}>[]>);
        update: ((params: Record<string, Record<string, unknown>>) => Promise<boolean>);
    }
  • Returns {
        create: ((params: InsertParams<T>, info: GraphQLResolveInfo) => Promise<PartialDeep<T["model"], {}>>);
        delete: ((params: Record<string, Record<string, unknown>>) => Promise<boolean>);
        read: ((params: Record<string, unknown>, info: GraphQLResolveInfo) => Promise<PartialDeep<T["model"], {}>[]>);
        update: ((params: Record<string, Record<string, unknown>>) => Promise<boolean>);
    }

    • create: ((params: InsertParams<T>, info: GraphQLResolveInfo) => Promise<PartialDeep<T["model"], {}>>)
        • (params: InsertParams<T>, info: GraphQLResolveInfo): Promise<PartialDeep<T["model"], {}>>
        • Parameters

          Returns Promise<PartialDeep<T["model"], {}>>

    • delete: ((params: Record<string, Record<string, unknown>>) => Promise<boolean>)
        • (params: Record<string, Record<string, unknown>>): Promise<boolean>
        • Parameters

          • params: Record<string, Record<string, unknown>>

          Returns Promise<boolean>

    • read: ((params: Record<string, unknown>, info: GraphQLResolveInfo) => Promise<PartialDeep<T["model"], {}>[]>)
        • (params: Record<string, unknown>, info: GraphQLResolveInfo): Promise<PartialDeep<T["model"], {}>[]>
        • Parameters

          • params: Record<string, unknown>
          • info: GraphQLResolveInfo

          Returns Promise<PartialDeep<T["model"], {}>[]>

    • update: ((params: Record<string, Record<string, unknown>>) => Promise<boolean>)
        • (params: Record<string, Record<string, unknown>>): Promise<boolean>
        • Parameters

          • params: Record<string, Record<string, unknown>>

          Returns Promise<boolean>

Methods

  • Type Parameters

    Parameters

    Returns Promise<Expand<keyof A["by"] extends never ? { [ K in string | number | symbol]: A["aggregations"][K]["operation"] extends "count" ? number : null | number } : ({ [ K in string | number | symbol]: K extends string ? TypeTraversal<T["insert"], K> : K extends keyof T["insert"] ? T["insert"][K] : never } & { [ K in string | number | symbol]: A["aggregations"][K]["operation"] extends "count" ? number : null | number })[]>>

  • Parameters

    • typeMap: Partial<Record<keyof T["scalars"], {
          arrayType?: string;
          singleType: string;
      }>>
    • defaultType: {
          arrayType?: string;
          singleType: string;
      }
      • Optional arrayType?: string
      • singleType: string

    Returns Promise<void>

  • Type Parameters

    • P extends any

    Parameters

    Returns Promise<{
        records: Project<T["entity"], T["ast"], T["scalars"], P, T["types"]>[];
        totalCount: number;
    }>

  • Type Parameters

    • I extends any

    • P extends any

    Parameters

    • params: {
          input: I;
          options?: T["driverFindOptions"];
          projection: P;
          relations?: T["relations"];
      } & OperationParams<T>

    Returns Promise<I extends unknown[] ? Project<T["entity"], T["ast"], T["scalars"], P, T["types"]>[] : Project<T["entity"], T["ast"], T["scalars"], P, T["types"]>>

Generated using TypeDoc