-
Notifications
You must be signed in to change notification settings - Fork 159
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
feature: impl graphql relay resolver for user and group #1719
Conversation
It works properly. group_nodes(order:"-name") {
edges {
node {
id
name
user_nodes(first:1) {
edges {
node {
username
}
}
count
}
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
} |
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.
👍
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.
Just a minor refactoring to make it more readable:
SQLInfoForGQLConn
→ GraphQLConnectionSQLInfo
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.
Minor fixes and suggestions. Thanks for the job!
group_node = graphene.Field( | ||
GroupNode, id=graphene.String(required=True), description="Added in 24.03.0." | ||
) |
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.
If AsyncNode
is to handle Relay Global ID, how about setting id
field to AsyncNode
itself?
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.
I have tried it, but it needs so much work. so I deprioritized this task
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.
Let's try this in next PR!
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.
LGTM!
I'm wondering if there can be a better name than OrderingItem
to emphasize the action "ordering".
Backported-from: main (24.03) Backported-to: 23.09
Implement async compatible graphql relay Node and Connection types.
Implement user/group relay Node and Connection.
Why re-invent GraphQL relay?
Current Graphene(v 3.3.0) has a relay implementation but it does not support asynchronous resolver functions. Additionally, Graphene Connection resolver is implemented to only accept one complete array(
Iterable
value) without considering pagination, which is a huge performance issue.Here, the newly "invented" Connection took pagination into account. But, pagination order of this Connection can only be either forward or backward in a single query, meaning that queries such as
first
andlast
together orafter
andbefore
together are limited.Query all groups
Query group with relay id
Query node with node's global id
Checklist: (if applicable)