Cache.modify inserts fragments to all queries regardless of query variable

Hi there,

First, thanks for your input and suggestion.
I’ve tried manually adding id: sourceDetails:${sd.id}`` to the writeFragment method and also checking that the refs contatin _typename.
Manually adding the id unfortunately didn’t do the trick and upon checking the refs returned from the writeFragment, they all contain the __typename correctly.

I also tried changing the query to the below however with no avail.

const GET_SOURCE_DETAILS_FOR_SOURCE: TypedDocumentNode<{
  sourceDetails: sourceDetail[];
}> = gql`
  ${SOURCE_DETAIL_FIELDS}
  query GET_SOURCE_DETAILS_FOR_SOURCE($id: Int!) {
    sourceDetails(where: { sourceId: { _eq: $id } }) {
      ...SourceDetailFields
    }
  }
`;

And below is the shape of the data for sourceDetail

sourceDetails:69
__typename:"sourceDetails"
id:69
sourceId:21
companyId:6
name:null
__ref:"sources:21"
__ref:"companies:6"

Would there be any other information that I can put up to better understand the source of problem…?