Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queryBuilder.getOneOrFail #6246

Closed
xenoterracide opened this issue Jun 11, 2020 · 3 comments · Fixed by #6885
Closed

queryBuilder.getOneOrFail #6246

xenoterracide opened this issue Jun 11, 2020 · 3 comments · Fixed by #6885
Assignees

Comments

@xenoterracide
Copy link

Issue type:

[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue

TypeORM version:

> yarn list typeorm                        # service-graph -> feature/RS2-1053-deliverables-product-resolver $ !
yarn list v1.22.4
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ typeorm@0.2.25
✨  Done in 1.17s.

Steps to reproduce or a small repository showing the problem:

I just want to be able to write

    this.createQueryBuilder('a')...getOneOrFail()

so my more complex query can behave the same way with the same exception type as a simpler query.

@imnotjames imnotjames self-assigned this Oct 3, 2020
@imnotjames
Copy link
Contributor

This seems like a good idea! I'll take a look :D

imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 10, 2020
This adds a `getOneOrFail` which which is to `getOne` as
`findOneOrFail` is to `findOne` - it never returns `undefined`,
it will instead throw an `EntityNotFoundError`

closes typeorm#6246
imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 10, 2020
This adds a `getOneOrFail` which which is to `getOne` as
`findOneOrFail` is to `findOne` - it never returns `undefined`,
it will instead throw an `EntityNotFoundError`

closes typeorm#6246
@imnotjames
Copy link
Contributor

PR ready to go. :) Waiting on tests.

imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 11, 2020
This adds a `getOneOrFail` which which is to `getOne` as
`findOneOrFail` is to `findOne` - it never returns `undefined`,
it will instead throw an `EntityNotFoundError`

closes typeorm#6246
imnotjames added a commit to imnotjames/typeorm that referenced this issue Oct 11, 2020
This adds a `getOneOrFail` which which is to `getOne` as
`findOneOrFail` is to `findOne` - it never returns `undefined`,
it will instead throw an `EntityNotFoundError`

closes typeorm#6246
imnotjames added a commit that referenced this issue Oct 16, 2020
This adds a `getOneOrFail` which which is to `getOne` as
`findOneOrFail` is to `findOne` - it never returns `undefined`,
it will instead throw an `EntityNotFoundError`

closes #6246
zaro pushed a commit to zaro/typeorm that referenced this issue Jan 12, 2021
This adds a `getOneOrFail` which which is to `getOne` as
`findOneOrFail` is to `findOne` - it never returns `undefined`,
it will instead throw an `EntityNotFoundError`

closes typeorm#6246
@gabeodessru
Copy link

How come this got closed? I'd love to see this added ❤️

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

Successfully merging a pull request may close this issue.

3 participants