-
Notifications
You must be signed in to change notification settings - Fork 6
[EdgeDB] Pin queries #3208
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
[EdgeDB] Pin queries #3208
Conversation
export class PinEdgeDBRepository implements PublicOf<PinRepository> { | ||
constructor(@Inject(Client) private readonly client: Client) {} | ||
|
||
async isPinned(id: ID, session: Session): Promise<boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CarsonF - Since the schema itself defines a pinned
property that is automatically inherited by any type that implements the Pinnable
abstract type, doesn't that make this isPinned
method unneeded in the EdgeDB world?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pinned
property is a computed shortcut.
User.pins
holds the links for the Pinnable
objects that user has pinned.
So this could query cast the ID to the Pinnable
instance and then check the pinned
property on it.
That uses the current user global which has already been connected in the app code in another layer.
select (<Pinnable><uuid>$id).pinned
Or
with obj := <Pinnable><uuid>$id
select obj.pinned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a paste from AI? BaseNode
, PinnedRelation
, pinned_by
don't exist within our schema.
Pins can be adjusted by +=
or -=
from the User.pins
link.
update global currentUser
set {
pins += <Mixin::Pinnable><uuid>$id
}
Though QB is preferred. Look at the other edgedb repos in the codebase for examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't needed since Pinnable
isn't a Resource
.
export class PinEdgeDBRepository implements PublicOf<PinRepository> { | ||
constructor(@Inject(Client) private readonly client: Client) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export class PinEdgeDBRepository implements PublicOf<PinRepository> { | |
constructor(@Inject(Client) private readonly client: Client) {} | |
export class PinEdgeDBRepository | |
extends CommonRepository | |
implements PublicOf<PinRepository> { |
Co-authored-by: Carson Full <carson_full@tsco.org>
- Use ~/common & ~/core - Import/export DTOs always from their folder instead of rollup to component folder - Stop rolling up database (neo4j) to core - Shorten where possible
…r to catch UnauthorizedException (#3213)
This allows certain code paths to use a changed url after app init.
No functional change.
Monday task
https://seed-company-squad.monday.com/boards/5989610236/pulses/5792971662
Description
Ready for review checklist