---
# System prepended metadata

title: 'C+ feed item page, refresh control - Mon 14th September'
tags: [refreshcontrol, C+, pulltorefresh, programmingjournal, rgdevs, '2020', apolloclient]

---

# C+ feed item page, refresh control - Mon 14th September

Sprint 1 of new C+ work. I built out the feed item dedicated page, added [Refresh Control](https://reactnative.dev/docs/refreshcontrol) to the Feed FlatList to add "pull to refresh" functionality, and we started mocking the feed query.

J, D and I also had a meeting around creating tasks for the JS devs around infrastructure updates. We feel this stuff both needs to be done (and currently is always J or I doing it), and it will help the other JS devs in better understanding our newer tech stack that some are still struggling with. 

Tasks include checking and merging Dependabot auto PRs, updating type definions, React component library updates, and more.

### Learnings
We updated C+ to Apollo Client 3. As we need to maintain backwards compatibility with 2, I utilised type merging to extend the `ApolloCache` type to add `writeData`, which no longer exists in Apollo Client 3, so that our cache update function type definions would match.

```typescript=
import { Cache, DataProxy, DocumentNode, Reference, StoreObject, Transaction } from '@apollo/client'

declare module '@apollo/client' {
    export declare abstract class ApolloCache<TSerialized> implements DataProxy {
    // ...other stuff
     /** done to maintain backwards compatibility with Apollo Client 2. DO NOT USE writeData */
        writeData: (args: any) => void
    }
}
```

###### tags: `programmingjournal` `2020` `C+` `refreshcontrol` `pulltorefresh` `apolloclient` `rgdevs`