I'm using React hooks both to fetch GraphQL data with `react-apollo` and to store local state:

```
const [userData, setUserData] = useState({})
const { loading, error, data } = useQuery(USER_QUERY)

```

However, I'm wondering how to store `data` to `userData`. Is this how it's supposed to work:

```
useEffect(() => {
  setUserData(data)
}, [Object.entries(data).length])

```