-
Notifications
You must be signed in to change notification settings - Fork 227
Added support for total count on relay connections #104
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
Conversation
@syrusakbary have you had a chance to review this pr? Thanks |
@syrusakbary sorry to bother you again. It's been more than a month without any feedback and I just wanted if you are still supporting this library or if I should consider creating another package |
@CaselIT I've already merged your code into my project 😂, can't wait that long. |
Can we merge this in? Highly needed |
Why the hell was this never merged in? |
@syrusakbary I'm assuming this was not merged in, as you can just override the classes yourself? |
@Kazanz you can override the class, but for it to work everywhere you need to patch the import in the library before creating any types with something along the lines of from graphene_sqlalchemy import types
types.Connection = ConnectionWithCount which is clearly not the best way to achieve this. I'm not really sure why it has not been merged. |
I've submitted a more general solution that will enable you to define your own Connection with count #120. |
@nikordaris Nice. I'll close this one in favor of your implementation. Hopefully it will be merged.. |
This PR adds support for returning the length of a
ConnectionField
under the argumenttotalCount
Example query:
{ allArticles { totalCount } }
will return
{ "allArticles": { "totalCount": <number of articles> } }
This option is added by default, but can be disabled by adding
total_count = False
to theMeta
of a node line as in the example below:I've added the tests for this, but I do not know where should I add the documentation. What's your advice @syrusakbary
Closes #58