Hi there, friends, I’ve got a Relay+GraphQL puzzle...
# prisma-whats-new
t
Hi there, friends, I’ve got a Relay+GraphQL puzzle I can’t quite figure out the right approach to!
n
@ticky haha, those are my favorite ones 🤔
t
We’ve got a container which has these data requirements (trimmed slightly for brevity!);
Copy code
fragment on OrganizationMember {
  id
  user {
    id
    uuid
  }
  organization {
    id
    teams(search: $teamAddSearch, first: 10) {
      edges {
        node {
          id
        }
      }
    }
  }
}
What this is for is for adding the
user
to teams within their
organization
. We have a
TeamMemberCreateMutation
which results in a
teamMember
appearing in
user.teams
(used elsewhere), but what we end up with is that we can’t invalidate
organization.teams
!
organization.teams
is searchable, but its results are cached aggressively, such that even if we
forceFetch
the container here, searches for the same query result in the same data, even if it was supposed to be removed
I suspect we need to implement a suitable fatQuery but I haven’t the faintest clue how this’d work in this instance, or if it’d defeat the cache issues!
n
ah so I'm not familiar with the interaction of fatQuery and using query arguments like
search
t
right, hmm
the other thing I was looking into is whether I can clear the cache for a container and… it looks like no
it seems like it might be possible if I inject a custom cache manager, but that seems a little hardcore
especially if we’re planning to move to relay Modern soon? 😓