You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constmovieItemFragment=graphql(/* GraphQL */` fragment MovieItemFragment on Movie { id title }`);constrelatedFragment=graphql(/* GraphQL */` fragment RelatedMoviesFragment on Movie { foo related { ...MovieItemFragment } }`);constupsellFragment=graphql(/* GraphQL */` fragment UpsellMoviesFragment on Movie { bar upsells { ...MovieItemFragment } }`);constmovieDetailsFragment=graphql(/* GraphQL */` fragment DetailsFragment on Movie { ...MovieItemFragment ...RelatedMoviesFragment ...UpsellMoviesFragment }`);constmoviesQueryDocument=graphql(/* GraphQL */` query Movie($id: ID!) { movie(id: $id) { ...DetailsFragment __typename } }`);
Above you can that the RelatedMoviesFragment and the UpsellMoviesFragment are also on the Movie type, so the __typename check will no longer work
I would expect to be able to do something like this, but it does not seem to work, as upsells and and related no longer exist on MovieFragment because they are not literal unions, for example the foo and bar keys will also not exist
constrelatedMovies=makeFragmentData(relatedFragment,videoDetail?.related// this key will not exist in the typings);constupsellMoviesFragment=makeFragmentData(upsellFragment,videoDetail?.upsells// this key will not exist in the typings);
The text was updated successfully, but these errors were encountered:
Also while debugging this, should the fragment not be the last parameter, but in the example, it's the first, but when checking the types generated from makeFragmentData, the first parameter is data
With the nested fragments example: https://github.com/charlypoly/codegen-repros/blob/master/client-preset-nested-fragments-interface/src/App.tsx is it possible to use fragments with the same
__typename
, for exampleAbove you can that the
RelatedMoviesFragment
and theUpsellMoviesFragment
are also on theMovie
type, so the__typename
check will no longer workI would expect to be able to do something like this, but it does not seem to work, as
upsells
and andrelated
no longer exist onMovieFragment
because they are not literal unions, for example thefoo
andbar
keys will also not existThe text was updated successfully, but these errors were encountered: