Skip to content

GraphOptions.joinOperation is incorrectly typed as required #1954

@IlyaSemenov

Description

@IlyaSemenov

GraphOptions.joinOperation is typed as required here:

export interface GraphOptions {
minimize?: boolean;
separator?: string;
aliases?: string[];
joinOperation: string;
maxBatchSize?: number;
}

which is not correct because it defaults to leftJoin.

In particular, this leads to Typescript error in innocent uses like:

MyModel.query().withGraphFetched("foo", { maxBatchSize: 1 })

result:

Argument of type '{ maxBatchSize: number; }' is not assignable to parameter of type 'GraphOptions'.
  Property 'joinOperation' is missing in type '{ maxBatchSize: number; }' but required in type 'GraphOptions'.ts(2345)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions