Skip to content

This example from the document doesn't work. #248

Closed

Description

@laukaichung

I'm using the latest 0.0.9-alpha.2 version. I found that this innerJoinAndSelect/leftJoinAndSelect method no longer works:

//If we want to load post with specific of its categories:
const posts = await connection
            .getRepository(Post)
            .createQueryBuilder("post")
            .innerJoinAndSelect("post.categories", "category", "category.name=:myCategory", { myCategory: "world" })
            .getMany();

I'm getting this error

Error:(49, 95) TS2345:Argument of type '{ myCategory: string; }' is not assignable to parameter of type 'JoinOptions'.
  Object literal may only specify known properties, and 'myCategory' does not exist in type 'JoinOptions'.

Activity

  1. pleerock commented on Feb 2, 2017

    @pleerock
    Member

    Use setParameter instead. Using extra parameters in joins are deprecated, because in the future there will be parameters related to join itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions