diff --git a/app/graphql/types/prefix_connection_with_total_count_type.rb b/app/graphql/types/prefix_connection_with_total_count_type.rb index a044238c0..d242574b2 100644 --- a/app/graphql/types/prefix_connection_with_total_count_type.rb +++ b/app/graphql/types/prefix_connection_with_total_count_type.rb @@ -13,14 +13,14 @@ def total_count def states args = self.object.arguments - + if object.parent.class.name == "Provider" collection = object.parent.provider_prefixes.joins(:prefix) if args[:state].present? [{ id: args[:state], title: args[:state].underscore.humanize, - count: collection.count }] + count: collection.state(args[:state].underscore.dasherize).count }] else [{ id: "withoutClient", title: "Without client",