Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two queries with the same typeName #10256

Closed
liorpevzner opened this issue Nov 2, 2022 · 1 comment
Closed

two queries with the same typeName #10256

liorpevzner opened this issue Nov 2, 2022 · 1 comment

Comments

@liorpevzner
Copy link

liorpevzner commented Nov 2, 2022

I have two different queries that both return the an object with the same key, and typeName but the value is different.
apollo cache overrides those queries.
I tried following this thread, but I got confused and it wasn't exactly the same:
#9192

so my firstQuery returns:

{
  "data": {
    "getCurrent": {
     {....some object"},
      "__typename": "Customer"
    }
  }
}

the second query returns:

{
  "data": {
    "getCurrent": {
      {... different object}
      },
      "__typename": "Customer"
    }
  }
}

im trying to define the typePolicies correctly...
so I can do:

Customer:{
keyFields:[?],
}

Can anyone point me to the right direction?

@bignimbus
Copy link
Contributor

Hi @liorpevzner, thanks for opening this issue! If you think this is related to the issue you referenced, may I suggest closing this issue and posting your comment in that thread to consolidate? If this is a distinct concern, though, would you be open to posting some more details? I think the data in some object and different object may be information that can help narrow down what might be happening. Our community forums are a great place to ask and answer questions like this as well. Thanks again!

@alessbell alessbell removed the 🏓 awaiting-contributor-response requires input from a contributor label Dec 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants