-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
turbo
cache is not including fragments that are defined separately (like fragment colocation)
#289
Comments
That's odd, somehow TypeScript is refusing to evaluate the symbol in the It is odd that the document that the cache produces for you initially is also empty 😅 A bit confused atm as even when I mold this more into our example of One interesting thing is that without the cache the query document node looks like const PokemonsQuery: TadaDocumentNode<{
pokemons: ({
[$tada.fragmentRefs]: {
PokemonItem: "Pokemon";
};
id: string;
} | null)[] | null;
}, {
limit?: number | null | undefined;
}, void> With the cache const PokemonsQuery: TadaDocumentNode<{}, {
limit?: number | null | undefined;
}, {
fragment: "Pokemons";
on: unknown;
masked: true;
}> |
We had a similar issue before this related to a |
Just a heads up, I haven't forgotten about this, but the behaviour is really odd. The result of Edit: This might be related to a bug in either our code or |
@dnlsandiego: This proved to be hard to reproduce, but it was easy to track down in the end. I'm not sure how we didn't catch this in other reproductions/examples, but it basically came down to a missing |
Describe the bug
It looks like the
turbo
command isn't including fragments in the generated cache file. Which results in an incompletegraphql-cache.d.ts
, breaking types in the editor.I've created a small repo in the reproduction link. But it's basically the
example-pokemon-api
in the examples folder.Given:
Running
gql.tada turbo
results in a graphql-cache.d.ts that hasPokemonItem
is being spread here but it's not included anywhere. Compared to when the fragment is in the same document:A warning is also shown
Reproduction
https://github.com/dnlsandiego/gql.tada-cache-issue
gql.tada version
gql.tada
1.7.0
@0no-co/graphqlsp
^1.12.2
Validations
The text was updated successfully, but these errors were encountered: