diff --git a/app/graph/types/me_type.rb b/app/graph/types/me_type.rb index 71d1e950e1..390e0bb019 100644 --- a/app/graph/types/me_type.rb +++ b/app/graph/types/me_type.rb @@ -125,6 +125,14 @@ def team_users(status: nil) team_users end + field :team_users_count, GraphQL::Types::Int, null: true do + argument :status, GraphQL::Types::String, required: false + end + + def team_users_count(status: nil) + team_users(status: status).count + end + field :annotations, AnnotationType.connection_type, null: true do argument :type, GraphQL::Types::String, required: false end diff --git a/lib/relay.idl b/lib/relay.idl index 971dc984be..dfb9aaec5e 100644 --- a/lib/relay.idl +++ b/lib/relay.idl @@ -9017,6 +9017,7 @@ type Me implements Node { last: Int status: String ): TeamUserConnection + team_users_count(status: String): Int teams( """ Returns the elements in the list that come after the specified cursor. diff --git a/public/relay.json b/public/relay.json index ac91f7ed16..ee7d71faff 100644 --- a/public/relay.json +++ b/public/relay.json @@ -49180,6 +49180,31 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "team_users_count", + "description": null, + "args": [ + { + "name": "status", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "teams", "description": null, diff --git a/test/controllers/graphql_controller_10_test.rb b/test/controllers/graphql_controller_10_test.rb index 781852d57a..b7ad00320f 100644 --- a/test/controllers/graphql_controller_10_test.rb +++ b/test/controllers/graphql_controller_10_test.rb @@ -87,7 +87,7 @@ def setup assert_equal 3, data.size assert_equal [u.id, u2.id, u3.id], ids.sort # Quey bot - query = "query { me { dbid, get_send_email_notifications, get_send_successful_login_notifications, get_send_failed_login_notifications, source { medias(first: 1) { edges { node { id } } } }, annotations(first: 1) { edges { node { id } } }, team_users(first: 1) { edges { node { id } } }, bot { get_description, get_role, get_version, get_source_code_url } } }" + query = "query { me { dbid, get_send_email_notifications, get_send_successful_login_notifications, get_send_failed_login_notifications, source { medias(first: 1) { edges { node { id } } } }, annotations(first: 1) { edges { node { id } } }, team_users_count, team_users(first: 1) { edges { node { id } } }, bot { get_description, get_role, get_version, get_source_code_url } } }" post :create, params: { query: query } assert_response :success end