1

For example, I have:

query {
  authors {
     id
     name
     twitterHandler
   }
 }

And:

query {
  posts {
    id
    author {
      id
      name
      twitterHandler
    }
   body
   title
  }
}

I do these requests sequentially and synchronously. My question is, will URQL get author entity of post from cache ? If yes, how to determine it ? Are there any logs on console or devtools which says: "This part I got from cache" ?

P.S. I am using graphcache

1 Answers1

0

Assume this is your query;

 const [result] = useQuery({
    query: <QUERY-NAME>,
    variables: {
      <VARIABLES>,
    },
  })

By examining following property path:

result.operation.context you will see the following where is the information you look for.

I wonder what is the use case for this?

{
  "url": "/path/to/graphql",
  "preferGetMethod": false,
  "requestPolicy": "network-only",
  "suspense": false,
  "meta": {
    "cacheOutcome": "miss" <- HERE
  }
}
Marko
  • 83
  • 1
  • 7