Skip to content

Commit

Permalink
Use "random" argument passed to GraphQL team query
Browse files Browse the repository at this point in the history
This is temporarily needed in order to bypass Relay compat cache. Shouldn't be needed once the client is completely migrated to Relay modern.

Fixes CV2-3775.
  • Loading branch information
caiosba authored Sep 25, 2023
1 parent fbadba1 commit 55beb5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/graph/types/query_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ def me
argument :random, GraphQL::Types::String, required: false
end

def team(id: nil, slug: nil, _random: nil)
def team(id: nil, slug: nil, random: nil)
tid = id.to_i
if !slug.blank?
unless slug.blank?
team = Team.where(slug: slug).first
tid = team.id unless team.nil?
end
team.reload if random
tid = Team.current&.id || User.current&.teams&.first&.id if tid === 0
GraphqlCrudOperations.load_if_can(Team, tid.to_i, context)
end
Expand Down

0 comments on commit 55beb5c

Please sign in to comment.