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

Type error returning IGNORE object when using a generic TypedDocumentNode mutation #11945

Closed
sneyderdev opened this issue Jul 10, 2024 · 3 comments · Fixed by #11944
Closed

Comments

@sneyderdev
Copy link
Contributor

sneyderdev commented Jul 10, 2024

Issue Description

There's a type error when returning the IGNORE sentinel object from optimisticResponse that is inferring from a TypedDocumentNode<>.

Given the following document:
image

We get the following type error:
image

I've checked the type definitions and it's fixed if we explicitly return an union type instead of only returning the inferred type. I created a PR #11944 changing this.

Link to Reproduction

https://codesandbox.io/p/sandbox/optimisticresponse-apollo-ts-error-mv34ws

Reproduction Steps

No response

@apollo/client version

3.10.8

@sneyderdev sneyderdev changed the title Type error returning IGNORE object when using a generic TypedDocumentedNode mutation Type error returning IGNORE object when using a generic TypedDocumentNode mutation Jul 10, 2024
@phryneas
Copy link
Member

Good catch - answering in the PR :)

Copy link
Contributor

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.

Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants