apollographql / apollo-client

:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
https://apollographql.com/client
MIT License
19.38k stars 2.66k forks source link

Why does cache read and write operation takes a lot of time when we define client-side variable to a fragment? #12032

Closed karan2227 closed 2 months ago

karan2227 commented 2 months ago
const TYPE_POLICIES = {
  Response: {
    fields: {
      adaptedOnUI(currentValue) {
        return Boolean(currentValue);
      },
    },
  },
}
fragment Response on Response {
   totalCount
   data {
      ...Data
   }
   adaptedOnUI @client
}

fragment Data on Data {
  id
  name
  position
}

client.readQuery and client.writeQuery takes more time compared to when there is no client-side variable defined in the type policy.

phryneas commented 2 months ago

Hi @karan2227!

How much time are you talking here? Do you have any executable example we could look at?

karan2227 commented 2 months ago

not much impact, my bad. closing this

github-actions[bot] commented 2 months ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.