I am trying to use cache.modify to change the status and feeling for one of the movies in the following query. I can’t figure out what to pass cache.identify() to get this query.
ROOT_QUERY:
searchMovies:{"data":{"term":"hoosiers"}}:
cursor: null
movies:
610b67ac02500b064693f29b:
__typename: "MovieStatus"
movie : {__ref: 'Movie:610b67ac02500b064693f29b'}
status: null
feeling: null
610b67b202500b064694368f: {__typename: 'MovieStatus', movie: {…}, status: null, feeling: null}
610b67c202500b064694edc7: {__typename: 'MovieStatus', movie: {…}, status: null, feeling: null}
610b682d02500b0646999238: {__typename: 'MovieStatus', movie: {…}, status: null, feeling: null}
610b682202500b0646992249: {__typename: 'MovieStatus', movie: {…}, status: null, feeling: null}
610b684602500b06469a9b78: {__typename: 'MovieStatus', movie: {…}, status: null, feeling: null}
[[Prototype]]: Object
totalCount: 6
[[Prototype]]: Object
I tried using cache.readQuery:
const search = cache.readQuery({
query: SEARCH_MOVIES_QUERY,
variables: {
term: searchTerm
}
})
but I get an error: (Invariant Violation: Invariant Violation: 44)