Skip to content

Commit

Permalink
CV2-4072: use PublicTeamType instead of TeamType
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy committed Jan 3, 2024
1 parent f5b03cc commit 57763b1
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/graph/mutations/duplicate_team_mutation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class DuplicateTeamMutation < Mutations::BaseMutation
argument :custom_slug, GraphQL::Types::String, required: false, camelize: false
argument :custom_name, GraphQL::Types::String, required: false, camelize: false

field :team, TeamType, null: true
field :team, PublicTeamType, null: true

def resolve(team_id:, custom_slug: nil, custom_name: nil)
_type_name, id = CheckGraphql.decode_id(team_id)
Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/feed_team_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class FeedTeamType < DefaultObject
field :dbid, GraphQL::Types::Int, null: true
field :filters, JsonStringType, null: true
field :saved_search_id, GraphQL::Types::Int, null: true
field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :feed, FeedType, null: true
field :team_id, GraphQL::Types::Int, null: true
field :feed_id, GraphQL::Types::Int, null: true
Expand Down
4 changes: 2 additions & 2 deletions app/graph/types/feed_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FeedType < DefaultObject
field :discoverable, GraphQL::Types::Boolean, null: true
field :user, UserType, null: true

field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :saved_search, SavedSearchType, null: true

field :requests, RequestType.connection_type, null: true do
Expand Down Expand Up @@ -50,6 +50,6 @@ def feed_invitations
object.feed_invitations
end

field :teams, TeamType.connection_type, null: false
field :teams, PublicTeamType.connection_type, null: false
field :feed_teams, FeedTeamType.connection_type, null: false
end
2 changes: 1 addition & 1 deletion app/graph/types/project_group_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ProjectGroupType < DefaultObject
field :title, GraphQL::Types::String, null: true
field :description, GraphQL::Types::String, null: true
field :team_id, GraphQL::Types::Int, null: true
field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :medias_count, GraphQL::Types::Int, null: true

field :projects, ProjectType.connection_type, null: true
Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/project_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ProjectType < DefaultObject
field :search_id, GraphQL::Types::String, null: true
field :url, GraphQL::Types::String, null: true
field :search, CheckSearchType, null: true
field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :project_group_id, GraphQL::Types::Int, null: true
field :project_group, ProjectGroupType, null: true
field :privacy, GraphQL::Types::Int, null: true
Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/saved_search_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SavedSearchType < DefaultObject
field :dbid, GraphQL::Types::Int, null: true
field :title, GraphQL::Types::String, null: true
field :team_id, GraphQL::Types::Int, null: true
field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :items_count, GraphQL::Types::Int, null: true
field :filters, GraphQL::Types::String, null: true

Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/team_task_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TeamTaskType < DefaultObject
field :options, JsonStringType, null: true
field :required, GraphQL::Types::Boolean, null: true
field :team_id, GraphQL::Types::Int, null: true
field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :json_schema, GraphQL::Types::String, null: true
field :order, GraphQL::Types::Int, null: true
field :fieldset, GraphQL::Types::String, null: true
Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/team_user_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TeamUserType < DefaultObject
field :status, GraphQL::Types::String, null: true
field :role, GraphQL::Types::String, null: true
field :permissions, GraphQL::Types::String, null: true
field :team, TeamType, null: true
field :team, PublicTeamType, null: true
field :user, UserType, null: true
field :invited_by, UserType, null: true

Expand Down
2 changes: 1 addition & 1 deletion app/graph/types/user_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def source
Source.find(object.source_id)
end

field :current_team, TeamType, null: true
field :current_team, PublicTeamType, null: true

def current_team
User.current == object ? object.current_team : nil
Expand Down
56 changes: 46 additions & 10 deletions lib/relay.idl
Original file line number Diff line number Diff line change
Expand Up @@ -4573,7 +4573,7 @@ type DuplicateTeamMutationPayload {
A unique identifier for the client performing the mutation.
"""
clientMutationId: String
team: Team
team: PublicTeam
}

type Dynamic implements Node {
Expand Down Expand Up @@ -8466,7 +8466,7 @@ type Feed implements Node {
saved_search: SavedSearch
saved_search_id: Int
tags: [String]
team: Team
team: PublicTeam
team_id: Int
teams(
"""
Expand All @@ -8488,7 +8488,7 @@ type Feed implements Node {
Returns the last _n_ elements from the list.
"""
last: Int
): TeamConnection!
): PublicTeamConnection!
teams_count: Int
updated_at: String
user: User
Expand Down Expand Up @@ -8599,7 +8599,7 @@ type FeedTeam implements Node {
saved_search: SavedSearch
saved_search_id: Int
shared: Boolean
team: Team
team: PublicTeam
team_id: Int
updated_at: String
}
Expand Down Expand Up @@ -10336,7 +10336,7 @@ type Project implements Node {
pusher_channel: String
search: CheckSearch
search_id: String
team: Team
team: PublicTeam
title: String!
updated_at: String
url: String
Expand Down Expand Up @@ -10409,7 +10409,7 @@ type ProjectGroup implements Node {
"""
last: Int
): ProjectConnection
team: Team
team: PublicTeam
team_id: Int
title: String
updated_at: String
Expand Down Expand Up @@ -11671,6 +11671,42 @@ type PublicTeam implements Node {
updated_at: String
}

"""
The connection type for PublicTeam.
"""
type PublicTeamConnection {
"""
A list of edges.
"""
edges: [PublicTeamEdge]

"""
A list of nodes.
"""
nodes: [PublicTeam]

"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
totalCount: Int
}

"""
An edge in a connection.
"""
type PublicTeamEdge {
"""
A cursor for use in pagination.
"""
cursor: String!

"""
The item at the end of the edge.
"""
node: PublicTeam
}

"""
The query root of this schema
"""
Expand Down Expand Up @@ -12197,7 +12233,7 @@ type SavedSearch implements Node {
is_part_of_feeds: Boolean
items_count: Int
permissions: String
team: Team
team: PublicTeam
team_id: Int
title: String
updated_at: String
Expand Down Expand Up @@ -13391,7 +13427,7 @@ type TeamTask implements Node {
show_in_browser_extension: Boolean
tasks_count: Int
tasks_with_answers_count: Int
team: Team
team: PublicTeam
team_id: Int
type: String
updated_at: String
Expand Down Expand Up @@ -13444,7 +13480,7 @@ type TeamUser implements Node {
permissions: String
role: String
status: String
team: Team
team: PublicTeam
team_id: Int
updated_at: String
user: User
Expand Down Expand Up @@ -16156,7 +16192,7 @@ type User implements Node {
confirmed: Boolean
created_at: String
current_project: Project
current_team: Team
current_team: PublicTeam
current_team_id: Int
dbid: Int
email: String
Expand Down
Loading

0 comments on commit 57763b1

Please sign in to comment.