From 97fa4039615e6df8b8c21ca69463cb8b2f279b0c Mon Sep 17 00:00:00 2001 From: nekocode Date: Sat, 26 Oct 2024 17:12:56 +0800 Subject: [PATCH] fix(typescript-react-apollo): fix #838 - fix the type returned by useSuspenseQuery --- .../types.reactApollo.customSuffix.tsx | 57 +++- dev-test/githunt/types.reactApollo.hooks.tsx | 46 +++- .../types.reactApollo.preResolveTypes.tsx | 46 +++- dev-test/githunt/types.reactApollo.tsx | 46 +++- dev-test/githunt/types.reactApollo.v2.tsx | 54 +++- .../__generated__/HeroAndFriendsNames.tsx | 21 +- .../star-wars/__generated__/HeroAppearsIn.tsx | 12 +- .../star-wars/__generated__/HeroDetails.tsx | 12 +- .../__generated__/HeroDetailsWithFragment.tsx | 30 ++- dev-test/star-wars/__generated__/HeroName.tsx | 15 +- .../__generated__/HeroNameConditional.tsx | 60 ++++- .../HeroParentTypeDependentField.tsx | 30 ++- .../HeroTypeDependentAliasedField.tsx | 30 ++- .../__generated__/HumanWithNullWeight.tsx | 21 +- .../star-wars/__generated__/TwoHeroes.tsx | 12 +- dev-test/star-wars/types.refetchFn.tsx | 243 +++++++++++++++++- dev-test/test-message/types.tsx | 12 +- 17 files changed, 709 insertions(+), 38 deletions(-) diff --git a/dev-test/githunt/types.reactApollo.customSuffix.tsx b/dev-test/githunt/types.reactApollo.customSuffix.tsx index 9e9520f49..71b092538 100644 --- a/dev-test/githunt/types.reactApollo.customSuffix.tsx +++ b/dev-test/githunt/types.reactApollo.customSuffix.tsx @@ -500,6 +500,14 @@ export function useCommentLazyQuery( options, ); } +export function useCommentSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useCommentSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useCommentSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -510,7 +518,9 @@ export function useCommentSuspenseQuery( return Apollo.useSuspenseQuery( CommentDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type CommentQueryHookResult = ReturnType; export type CommentLazyQueryHookResult = ReturnType; @@ -564,6 +574,26 @@ export function useCurrentUserForProfileLazyQuery( CurrentUserForProfileQueryVariables >(CurrentUserForProfileDocument, options); } +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQueryMyOperation, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQueryMyOperation, + CurrentUserForProfileQueryVariables +>; +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQueryMyOperation, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQueryMyOperation | undefined, + CurrentUserForProfileQueryVariables +>; export function useCurrentUserForProfileSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -577,7 +607,15 @@ export function useCurrentUserForProfileSuspenseQuery( return Apollo.useSuspenseQuery< CurrentUserForProfileQueryMyOperation, CurrentUserForProfileQueryVariables - >(CurrentUserForProfileDocument, options); + >(CurrentUserForProfileDocument, options) as + | Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQueryMyOperation, + CurrentUserForProfileQueryVariables + > + | Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQueryMyOperation | undefined, + CurrentUserForProfileQueryVariables + >; } export type CurrentUserForProfileQueryHookResult = ReturnType; export type CurrentUserForProfileLazyQueryHookResult = ReturnType< @@ -633,6 +671,14 @@ export function useFeedLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(FeedDocument, options); } +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useFeedSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useFeedSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -640,7 +686,12 @@ export function useFeedSuspenseQuery( ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(FeedDocument, options); + return Apollo.useSuspenseQuery( + FeedDocument, + options, + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type FeedQueryHookResult = ReturnType; export type FeedLazyQueryHookResult = ReturnType; diff --git a/dev-test/githunt/types.reactApollo.hooks.tsx b/dev-test/githunt/types.reactApollo.hooks.tsx index 4212db745..ac200cc75 100644 --- a/dev-test/githunt/types.reactApollo.hooks.tsx +++ b/dev-test/githunt/types.reactApollo.hooks.tsx @@ -543,6 +543,14 @@ export function useCommentLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(CommentDocument, options); } +export function useCommentSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useCommentSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useCommentSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -550,7 +558,9 @@ export function useCommentSuspenseQuery( ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(CommentDocument, options); + return Apollo.useSuspenseQuery(CommentDocument, options) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type CommentQueryHookResult = ReturnType; export type CommentLazyQueryHookResult = ReturnType; @@ -604,6 +614,23 @@ export function useCurrentUserForProfileLazyQuery( options, ); } +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables +>; export function useCurrentUserForProfileSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -617,7 +644,12 @@ export function useCurrentUserForProfileSuspenseQuery( return Apollo.useSuspenseQuery( CurrentUserForProfileDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables + >; } export type CurrentUserForProfileQueryHookResult = ReturnType; export type CurrentUserForProfileLazyQueryHookResult = ReturnType< @@ -673,12 +705,20 @@ export function useFeedLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(FeedDocument, options); } +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useFeedSuspenseQuery( baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions, ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(FeedDocument, options); + return Apollo.useSuspenseQuery(FeedDocument, options) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type FeedQueryHookResult = ReturnType; export type FeedLazyQueryHookResult = ReturnType; diff --git a/dev-test/githunt/types.reactApollo.preResolveTypes.tsx b/dev-test/githunt/types.reactApollo.preResolveTypes.tsx index 5a9956e3e..0fa6e9ddb 100644 --- a/dev-test/githunt/types.reactApollo.preResolveTypes.tsx +++ b/dev-test/githunt/types.reactApollo.preResolveTypes.tsx @@ -497,6 +497,14 @@ export function useCommentLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(CommentDocument, options); } +export function useCommentSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useCommentSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useCommentSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -504,7 +512,9 @@ export function useCommentSuspenseQuery( ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(CommentDocument, options); + return Apollo.useSuspenseQuery(CommentDocument, options) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type CommentQueryHookResult = ReturnType; export type CommentLazyQueryHookResult = ReturnType; @@ -558,6 +568,23 @@ export function useCurrentUserForProfileLazyQuery( options, ); } +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables +>; export function useCurrentUserForProfileSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -571,7 +598,12 @@ export function useCurrentUserForProfileSuspenseQuery( return Apollo.useSuspenseQuery( CurrentUserForProfileDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables + >; } export type CurrentUserForProfileQueryHookResult = ReturnType; export type CurrentUserForProfileLazyQueryHookResult = ReturnType< @@ -627,12 +659,20 @@ export function useFeedLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(FeedDocument, options); } +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useFeedSuspenseQuery( baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions, ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(FeedDocument, options); + return Apollo.useSuspenseQuery(FeedDocument, options) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type FeedQueryHookResult = ReturnType; export type FeedLazyQueryHookResult = ReturnType; diff --git a/dev-test/githunt/types.reactApollo.tsx b/dev-test/githunt/types.reactApollo.tsx index 5a9956e3e..0fa6e9ddb 100644 --- a/dev-test/githunt/types.reactApollo.tsx +++ b/dev-test/githunt/types.reactApollo.tsx @@ -497,6 +497,14 @@ export function useCommentLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(CommentDocument, options); } +export function useCommentSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useCommentSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useCommentSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -504,7 +512,9 @@ export function useCommentSuspenseQuery( ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(CommentDocument, options); + return Apollo.useSuspenseQuery(CommentDocument, options) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type CommentQueryHookResult = ReturnType; export type CommentLazyQueryHookResult = ReturnType; @@ -558,6 +568,23 @@ export function useCurrentUserForProfileLazyQuery( options, ); } +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables +>; export function useCurrentUserForProfileSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -571,7 +598,12 @@ export function useCurrentUserForProfileSuspenseQuery( return Apollo.useSuspenseQuery( CurrentUserForProfileDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables + >; } export type CurrentUserForProfileQueryHookResult = ReturnType; export type CurrentUserForProfileLazyQueryHookResult = ReturnType< @@ -627,12 +659,20 @@ export function useFeedLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(FeedDocument, options); } +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useFeedSuspenseQuery( + baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useFeedSuspenseQuery( baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions, ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(FeedDocument, options); + return Apollo.useSuspenseQuery(FeedDocument, options) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type FeedQueryHookResult = ReturnType; export type FeedLazyQueryHookResult = ReturnType; diff --git a/dev-test/githunt/types.reactApollo.v2.tsx b/dev-test/githunt/types.reactApollo.v2.tsx index 977261f5f..a6e576af2 100644 --- a/dev-test/githunt/types.reactApollo.v2.tsx +++ b/dev-test/githunt/types.reactApollo.v2.tsx @@ -501,6 +501,14 @@ export function useCommentLazyQuery( options, ); } +export function useCommentSuspenseQuery( + baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions, +): ApolloReactHooks.UseSuspenseQueryResult; +export function useCommentSuspenseQuery( + baseOptions?: + | ApolloReactHooks.SkipToken + | ApolloReactHooks.SuspenseQueryHookOptions, +): ApolloReactHooks.UseSuspenseQueryResult; export function useCommentSuspenseQuery( baseOptions?: | ApolloReactHooks.SkipToken @@ -513,7 +521,9 @@ export function useCommentSuspenseQuery( return ApolloReactHooks.useSuspenseQuery( CommentDocument, options, - ); + ) as + | ApolloReactHooks.UseSuspenseQueryResult + | ApolloReactHooks.UseSuspenseQueryResult; } export type CommentQueryHookResult = ReturnType; export type CommentLazyQueryHookResult = ReturnType; @@ -567,6 +577,26 @@ export function useCurrentUserForProfileLazyQuery( CurrentUserForProfileQueryVariables >(CurrentUserForProfileDocument, options); } +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): ApolloReactHooks.UseSuspenseQueryResult< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables +>; +export function useCurrentUserForProfileSuspenseQuery( + baseOptions?: + | ApolloReactHooks.SkipToken + | ApolloReactHooks.SuspenseQueryHookOptions< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + >, +): ApolloReactHooks.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables +>; export function useCurrentUserForProfileSuspenseQuery( baseOptions?: | ApolloReactHooks.SkipToken @@ -582,7 +612,15 @@ export function useCurrentUserForProfileSuspenseQuery( return ApolloReactHooks.useSuspenseQuery< CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables - >(CurrentUserForProfileDocument, options); + >(CurrentUserForProfileDocument, options) as + | ApolloReactHooks.UseSuspenseQueryResult< + CurrentUserForProfileQuery, + CurrentUserForProfileQueryVariables + > + | ApolloReactHooks.UseSuspenseQueryResult< + CurrentUserForProfileQuery | undefined, + CurrentUserForProfileQueryVariables + >; } export type CurrentUserForProfileQueryHookResult = ReturnType; export type CurrentUserForProfileLazyQueryHookResult = ReturnType< @@ -638,6 +676,14 @@ export function useFeedLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return ApolloReactHooks.useLazyQuery(FeedDocument, options); } +export function useFeedSuspenseQuery( + baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions, +): ApolloReactHooks.UseSuspenseQueryResult; +export function useFeedSuspenseQuery( + baseOptions?: + | ApolloReactHooks.SkipToken + | ApolloReactHooks.SuspenseQueryHookOptions, +): ApolloReactHooks.UseSuspenseQueryResult; export function useFeedSuspenseQuery( baseOptions?: | ApolloReactHooks.SkipToken @@ -647,7 +693,9 @@ export function useFeedSuspenseQuery( baseOptions === ApolloReactHooks.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return ApolloReactHooks.useSuspenseQuery(FeedDocument, options); + return ApolloReactHooks.useSuspenseQuery(FeedDocument, options) as + | ApolloReactHooks.UseSuspenseQueryResult + | ApolloReactHooks.UseSuspenseQueryResult; } export type FeedQueryHookResult = ReturnType; export type FeedLazyQueryHookResult = ReturnType; diff --git a/dev-test/star-wars/__generated__/HeroAndFriendsNames.tsx b/dev-test/star-wars/__generated__/HeroAndFriendsNames.tsx index 19e57573b..53972f6df 100644 --- a/dev-test/star-wars/__generated__/HeroAndFriendsNames.tsx +++ b/dev-test/star-wars/__generated__/HeroAndFriendsNames.tsx @@ -78,6 +78,20 @@ export function useHeroAndFriendsNamesLazyQuery( options, ); } +export function useHeroAndFriendsNamesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroAndFriendsNamesQuery, + HeroAndFriendsNamesQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useHeroAndFriendsNamesSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult< + HeroAndFriendsNamesQuery | undefined, + HeroAndFriendsNamesQueryVariables +>; export function useHeroAndFriendsNamesSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -88,7 +102,12 @@ export function useHeroAndFriendsNamesSuspenseQuery( return Apollo.useSuspenseQuery( HeroAndFriendsNamesDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + HeroAndFriendsNamesQuery | undefined, + HeroAndFriendsNamesQueryVariables + >; } export type HeroAndFriendsNamesQueryHookResult = ReturnType; export type HeroAndFriendsNamesLazyQueryHookResult = ReturnType< diff --git a/dev-test/star-wars/__generated__/HeroAppearsIn.tsx b/dev-test/star-wars/__generated__/HeroAppearsIn.tsx index 682368d87..bc676b330 100644 --- a/dev-test/star-wars/__generated__/HeroAppearsIn.tsx +++ b/dev-test/star-wars/__generated__/HeroAppearsIn.tsx @@ -55,6 +55,14 @@ export function useHeroAppearsInLazyQuery( options, ); } +export function useHeroAppearsInSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useHeroAppearsInSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useHeroAppearsInSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -65,7 +73,9 @@ export function useHeroAppearsInSuspenseQuery( return Apollo.useSuspenseQuery( HeroAppearsInDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type HeroAppearsInQueryHookResult = ReturnType; export type HeroAppearsInLazyQueryHookResult = ReturnType; diff --git a/dev-test/star-wars/__generated__/HeroDetails.tsx b/dev-test/star-wars/__generated__/HeroDetails.tsx index dd302c5a7..3212df80b 100644 --- a/dev-test/star-wars/__generated__/HeroDetails.tsx +++ b/dev-test/star-wars/__generated__/HeroDetails.tsx @@ -60,6 +60,14 @@ export function useHeroDetailsLazyQuery( options, ); } +export function useHeroDetailsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useHeroDetailsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useHeroDetailsSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -70,7 +78,9 @@ export function useHeroDetailsSuspenseQuery( return Apollo.useSuspenseQuery( HeroDetailsDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type HeroDetailsQueryHookResult = ReturnType; export type HeroDetailsLazyQueryHookResult = ReturnType; diff --git a/dev-test/star-wars/__generated__/HeroDetailsWithFragment.tsx b/dev-test/star-wars/__generated__/HeroDetailsWithFragment.tsx index 076637432..942d2ad0f 100644 --- a/dev-test/star-wars/__generated__/HeroDetailsWithFragment.tsx +++ b/dev-test/star-wars/__generated__/HeroDetailsWithFragment.tsx @@ -65,6 +65,26 @@ export function useHeroDetailsWithFragmentLazyQuery( options, ); } +export function useHeroDetailsWithFragmentSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables +>; +export function useHeroDetailsWithFragmentSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery | undefined, + HeroDetailsWithFragmentQueryVariables +>; export function useHeroDetailsWithFragmentSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -78,7 +98,15 @@ export function useHeroDetailsWithFragmentSuspenseQuery( return Apollo.useSuspenseQuery< HeroDetailsWithFragmentQuery, HeroDetailsWithFragmentQueryVariables - >(HeroDetailsWithFragmentDocument, options); + >(HeroDetailsWithFragmentDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery | undefined, + HeroDetailsWithFragmentQueryVariables + >; } export type HeroDetailsWithFragmentQueryHookResult = ReturnType< typeof useHeroDetailsWithFragmentQuery diff --git a/dev-test/star-wars/__generated__/HeroName.tsx b/dev-test/star-wars/__generated__/HeroName.tsx index 86b2fe10a..5843c7f54 100644 --- a/dev-test/star-wars/__generated__/HeroName.tsx +++ b/dev-test/star-wars/__generated__/HeroName.tsx @@ -48,6 +48,14 @@ export function useHeroNameLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(HeroNameDocument, options); } +export function useHeroNameSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useHeroNameSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useHeroNameSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -55,7 +63,12 @@ export function useHeroNameSuspenseQuery( ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(HeroNameDocument, options); + return Apollo.useSuspenseQuery( + HeroNameDocument, + options, + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type HeroNameQueryHookResult = ReturnType; export type HeroNameLazyQueryHookResult = ReturnType; diff --git a/dev-test/star-wars/__generated__/HeroNameConditional.tsx b/dev-test/star-wars/__generated__/HeroNameConditional.tsx index 2255e0e25..d413fc0b0 100644 --- a/dev-test/star-wars/__generated__/HeroNameConditional.tsx +++ b/dev-test/star-wars/__generated__/HeroNameConditional.tsx @@ -73,6 +73,26 @@ export function useHeroNameConditionalInclusionLazyQuery( HeroNameConditionalInclusionQueryVariables >(HeroNameConditionalInclusionDocument, options); } +export function useHeroNameConditionalInclusionSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables +>; +export function useHeroNameConditionalInclusionSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery | undefined, + HeroNameConditionalInclusionQueryVariables +>; export function useHeroNameConditionalInclusionSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -86,7 +106,15 @@ export function useHeroNameConditionalInclusionSuspenseQuery( return Apollo.useSuspenseQuery< HeroNameConditionalInclusionQuery, HeroNameConditionalInclusionQueryVariables - >(HeroNameConditionalInclusionDocument, options); + >(HeroNameConditionalInclusionDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery | undefined, + HeroNameConditionalInclusionQueryVariables + >; } export type HeroNameConditionalInclusionQueryHookResult = ReturnType< typeof useHeroNameConditionalInclusionQuery @@ -151,6 +179,26 @@ export function useHeroNameConditionalExclusionLazyQuery( HeroNameConditionalExclusionQueryVariables >(HeroNameConditionalExclusionDocument, options); } +export function useHeroNameConditionalExclusionSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables +>; +export function useHeroNameConditionalExclusionSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery | undefined, + HeroNameConditionalExclusionQueryVariables +>; export function useHeroNameConditionalExclusionSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -164,7 +212,15 @@ export function useHeroNameConditionalExclusionSuspenseQuery( return Apollo.useSuspenseQuery< HeroNameConditionalExclusionQuery, HeroNameConditionalExclusionQueryVariables - >(HeroNameConditionalExclusionDocument, options); + >(HeroNameConditionalExclusionDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery | undefined, + HeroNameConditionalExclusionQueryVariables + >; } export type HeroNameConditionalExclusionQueryHookResult = ReturnType< typeof useHeroNameConditionalExclusionQuery diff --git a/dev-test/star-wars/__generated__/HeroParentTypeDependentField.tsx b/dev-test/star-wars/__generated__/HeroParentTypeDependentField.tsx index 768f2af5a..fdcda8312 100644 --- a/dev-test/star-wars/__generated__/HeroParentTypeDependentField.tsx +++ b/dev-test/star-wars/__generated__/HeroParentTypeDependentField.tsx @@ -95,6 +95,26 @@ export function useHeroParentTypeDependentFieldLazyQuery( HeroParentTypeDependentFieldQueryVariables >(HeroParentTypeDependentFieldDocument, options); } +export function useHeroParentTypeDependentFieldSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables +>; +export function useHeroParentTypeDependentFieldSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery | undefined, + HeroParentTypeDependentFieldQueryVariables +>; export function useHeroParentTypeDependentFieldSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -108,7 +128,15 @@ export function useHeroParentTypeDependentFieldSuspenseQuery( return Apollo.useSuspenseQuery< HeroParentTypeDependentFieldQuery, HeroParentTypeDependentFieldQueryVariables - >(HeroParentTypeDependentFieldDocument, options); + >(HeroParentTypeDependentFieldDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery | undefined, + HeroParentTypeDependentFieldQueryVariables + >; } export type HeroParentTypeDependentFieldQueryHookResult = ReturnType< typeof useHeroParentTypeDependentFieldQuery diff --git a/dev-test/star-wars/__generated__/HeroTypeDependentAliasedField.tsx b/dev-test/star-wars/__generated__/HeroTypeDependentAliasedField.tsx index c57b6057f..ffb2a5fd0 100644 --- a/dev-test/star-wars/__generated__/HeroTypeDependentAliasedField.tsx +++ b/dev-test/star-wars/__generated__/HeroTypeDependentAliasedField.tsx @@ -68,6 +68,26 @@ export function useHeroTypeDependentAliasedFieldLazyQuery( HeroTypeDependentAliasedFieldQueryVariables >(HeroTypeDependentAliasedFieldDocument, options); } +export function useHeroTypeDependentAliasedFieldSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables +>; +export function useHeroTypeDependentAliasedFieldSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery | undefined, + HeroTypeDependentAliasedFieldQueryVariables +>; export function useHeroTypeDependentAliasedFieldSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -81,7 +101,15 @@ export function useHeroTypeDependentAliasedFieldSuspenseQuery( return Apollo.useSuspenseQuery< HeroTypeDependentAliasedFieldQuery, HeroTypeDependentAliasedFieldQueryVariables - >(HeroTypeDependentAliasedFieldDocument, options); + >(HeroTypeDependentAliasedFieldDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery | undefined, + HeroTypeDependentAliasedFieldQueryVariables + >; } export type HeroTypeDependentAliasedFieldQueryHookResult = ReturnType< typeof useHeroTypeDependentAliasedFieldQuery diff --git a/dev-test/star-wars/__generated__/HumanWithNullWeight.tsx b/dev-test/star-wars/__generated__/HumanWithNullWeight.tsx index 337dc6182..b3ea47d54 100644 --- a/dev-test/star-wars/__generated__/HumanWithNullWeight.tsx +++ b/dev-test/star-wars/__generated__/HumanWithNullWeight.tsx @@ -59,6 +59,20 @@ export function useHumanWithNullHeightLazyQuery( options, ); } +export function useHumanWithNullHeightSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HumanWithNullHeightQuery, + HumanWithNullHeightQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useHumanWithNullHeightSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult< + HumanWithNullHeightQuery | undefined, + HumanWithNullHeightQueryVariables +>; export function useHumanWithNullHeightSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -69,7 +83,12 @@ export function useHumanWithNullHeightSuspenseQuery( return Apollo.useSuspenseQuery( HumanWithNullHeightDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + HumanWithNullHeightQuery | undefined, + HumanWithNullHeightQueryVariables + >; } export type HumanWithNullHeightQueryHookResult = ReturnType; export type HumanWithNullHeightLazyQueryHookResult = ReturnType< diff --git a/dev-test/star-wars/__generated__/TwoHeroes.tsx b/dev-test/star-wars/__generated__/TwoHeroes.tsx index 207194163..299290245 100644 --- a/dev-test/star-wars/__generated__/TwoHeroes.tsx +++ b/dev-test/star-wars/__generated__/TwoHeroes.tsx @@ -49,6 +49,14 @@ export function useTwoHeroesLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(TwoHeroesDocument, options); } +export function useTwoHeroesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useTwoHeroesSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useTwoHeroesSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -59,7 +67,9 @@ export function useTwoHeroesSuspenseQuery( return Apollo.useSuspenseQuery( TwoHeroesDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type TwoHeroesQueryHookResult = ReturnType; export type TwoHeroesLazyQueryHookResult = ReturnType; diff --git a/dev-test/star-wars/types.refetchFn.tsx b/dev-test/star-wars/types.refetchFn.tsx index 32c933adb..10386d685 100644 --- a/dev-test/star-wars/types.refetchFn.tsx +++ b/dev-test/star-wars/types.refetchFn.tsx @@ -362,6 +362,20 @@ export function useHeroAndFriendsNamesLazyQuery( options, ); } +export function useHeroAndFriendsNamesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroAndFriendsNamesQuery, + HeroAndFriendsNamesQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useHeroAndFriendsNamesSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult< + HeroAndFriendsNamesQuery | undefined, + HeroAndFriendsNamesQueryVariables +>; export function useHeroAndFriendsNamesSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -372,7 +386,12 @@ export function useHeroAndFriendsNamesSuspenseQuery( return Apollo.useSuspenseQuery( HeroAndFriendsNamesDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + HeroAndFriendsNamesQuery | undefined, + HeroAndFriendsNamesQueryVariables + >; } export type HeroAndFriendsNamesQueryHookResult = ReturnType; export type HeroAndFriendsNamesLazyQueryHookResult = ReturnType< @@ -430,6 +449,14 @@ export function useHeroAppearsInLazyQuery( options, ); } +export function useHeroAppearsInSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useHeroAppearsInSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useHeroAppearsInSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -440,7 +467,9 @@ export function useHeroAppearsInSuspenseQuery( return Apollo.useSuspenseQuery( HeroAppearsInDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type HeroAppearsInQueryHookResult = ReturnType; export type HeroAppearsInLazyQueryHookResult = ReturnType; @@ -497,6 +526,14 @@ export function useHeroDetailsLazyQuery( options, ); } +export function useHeroDetailsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useHeroDetailsSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useHeroDetailsSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -507,7 +544,9 @@ export function useHeroDetailsSuspenseQuery( return Apollo.useSuspenseQuery( HeroDetailsDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type HeroDetailsQueryHookResult = ReturnType; export type HeroDetailsLazyQueryHookResult = ReturnType; @@ -568,6 +607,26 @@ export function useHeroDetailsWithFragmentLazyQuery( options, ); } +export function useHeroDetailsWithFragmentSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables +>; +export function useHeroDetailsWithFragmentSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery | undefined, + HeroDetailsWithFragmentQueryVariables +>; export function useHeroDetailsWithFragmentSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -581,7 +640,15 @@ export function useHeroDetailsWithFragmentSuspenseQuery( return Apollo.useSuspenseQuery< HeroDetailsWithFragmentQuery, HeroDetailsWithFragmentQueryVariables - >(HeroDetailsWithFragmentDocument, options); + >(HeroDetailsWithFragmentDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery, + HeroDetailsWithFragmentQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroDetailsWithFragmentQuery | undefined, + HeroDetailsWithFragmentQueryVariables + >; } export type HeroDetailsWithFragmentQueryHookResult = ReturnType< typeof useHeroDetailsWithFragmentQuery @@ -637,6 +704,14 @@ export function useHeroNameLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(HeroNameDocument, options); } +export function useHeroNameSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useHeroNameSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useHeroNameSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -644,7 +719,12 @@ export function useHeroNameSuspenseQuery( ) { const options = baseOptions === Apollo.skipToken ? baseOptions : { ...defaultOptions, ...baseOptions }; - return Apollo.useSuspenseQuery(HeroNameDocument, options); + return Apollo.useSuspenseQuery( + HeroNameDocument, + options, + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type HeroNameQueryHookResult = ReturnType; export type HeroNameLazyQueryHookResult = ReturnType; @@ -703,6 +783,26 @@ export function useHeroNameConditionalInclusionLazyQuery( HeroNameConditionalInclusionQueryVariables >(HeroNameConditionalInclusionDocument, options); } +export function useHeroNameConditionalInclusionSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables +>; +export function useHeroNameConditionalInclusionSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery | undefined, + HeroNameConditionalInclusionQueryVariables +>; export function useHeroNameConditionalInclusionSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -716,7 +816,15 @@ export function useHeroNameConditionalInclusionSuspenseQuery( return Apollo.useSuspenseQuery< HeroNameConditionalInclusionQuery, HeroNameConditionalInclusionQueryVariables - >(HeroNameConditionalInclusionDocument, options); + >(HeroNameConditionalInclusionDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery, + HeroNameConditionalInclusionQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalInclusionQuery | undefined, + HeroNameConditionalInclusionQueryVariables + >; } export type HeroNameConditionalInclusionQueryHookResult = ReturnType< typeof useHeroNameConditionalInclusionQuery @@ -786,6 +894,26 @@ export function useHeroNameConditionalExclusionLazyQuery( HeroNameConditionalExclusionQueryVariables >(HeroNameConditionalExclusionDocument, options); } +export function useHeroNameConditionalExclusionSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables +>; +export function useHeroNameConditionalExclusionSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery | undefined, + HeroNameConditionalExclusionQueryVariables +>; export function useHeroNameConditionalExclusionSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -799,7 +927,15 @@ export function useHeroNameConditionalExclusionSuspenseQuery( return Apollo.useSuspenseQuery< HeroNameConditionalExclusionQuery, HeroNameConditionalExclusionQueryVariables - >(HeroNameConditionalExclusionDocument, options); + >(HeroNameConditionalExclusionDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery, + HeroNameConditionalExclusionQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroNameConditionalExclusionQuery | undefined, + HeroNameConditionalExclusionQueryVariables + >; } export type HeroNameConditionalExclusionQueryHookResult = ReturnType< typeof useHeroNameConditionalExclusionQuery @@ -883,6 +1019,26 @@ export function useHeroParentTypeDependentFieldLazyQuery( HeroParentTypeDependentFieldQueryVariables >(HeroParentTypeDependentFieldDocument, options); } +export function useHeroParentTypeDependentFieldSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables +>; +export function useHeroParentTypeDependentFieldSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery | undefined, + HeroParentTypeDependentFieldQueryVariables +>; export function useHeroParentTypeDependentFieldSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -896,7 +1052,15 @@ export function useHeroParentTypeDependentFieldSuspenseQuery( return Apollo.useSuspenseQuery< HeroParentTypeDependentFieldQuery, HeroParentTypeDependentFieldQueryVariables - >(HeroParentTypeDependentFieldDocument, options); + >(HeroParentTypeDependentFieldDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery, + HeroParentTypeDependentFieldQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroParentTypeDependentFieldQuery | undefined, + HeroParentTypeDependentFieldQueryVariables + >; } export type HeroParentTypeDependentFieldQueryHookResult = ReturnType< typeof useHeroParentTypeDependentFieldQuery @@ -969,6 +1133,26 @@ export function useHeroTypeDependentAliasedFieldLazyQuery( HeroTypeDependentAliasedFieldQueryVariables >(HeroTypeDependentAliasedFieldDocument, options); } +export function useHeroTypeDependentAliasedFieldSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables +>; +export function useHeroTypeDependentAliasedFieldSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables + >, +): Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery | undefined, + HeroTypeDependentAliasedFieldQueryVariables +>; export function useHeroTypeDependentAliasedFieldSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -982,7 +1166,15 @@ export function useHeroTypeDependentAliasedFieldSuspenseQuery( return Apollo.useSuspenseQuery< HeroTypeDependentAliasedFieldQuery, HeroTypeDependentAliasedFieldQueryVariables - >(HeroTypeDependentAliasedFieldDocument, options); + >(HeroTypeDependentAliasedFieldDocument, options) as + | Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery, + HeroTypeDependentAliasedFieldQueryVariables + > + | Apollo.UseSuspenseQueryResult< + HeroTypeDependentAliasedFieldQuery | undefined, + HeroTypeDependentAliasedFieldQueryVariables + >; } export type HeroTypeDependentAliasedFieldQueryHookResult = ReturnType< typeof useHeroTypeDependentAliasedFieldQuery @@ -1050,6 +1242,20 @@ export function useHumanWithNullHeightLazyQuery( options, ); } +export function useHumanWithNullHeightSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + HumanWithNullHeightQuery, + HumanWithNullHeightQueryVariables + >, +): Apollo.UseSuspenseQueryResult; +export function useHumanWithNullHeightSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult< + HumanWithNullHeightQuery | undefined, + HumanWithNullHeightQueryVariables +>; export function useHumanWithNullHeightSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -1060,7 +1266,12 @@ export function useHumanWithNullHeightSuspenseQuery( return Apollo.useSuspenseQuery( HumanWithNullHeightDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult< + HumanWithNullHeightQuery | undefined, + HumanWithNullHeightQueryVariables + >; } export type HumanWithNullHeightQueryHookResult = ReturnType; export type HumanWithNullHeightLazyQueryHookResult = ReturnType< @@ -1114,6 +1325,14 @@ export function useTwoHeroesLazyQuery( const options = { ...defaultOptions, ...baseOptions }; return Apollo.useLazyQuery(TwoHeroesDocument, options); } +export function useTwoHeroesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useTwoHeroesSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useTwoHeroesSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -1124,7 +1343,9 @@ export function useTwoHeroesSuspenseQuery( return Apollo.useSuspenseQuery( TwoHeroesDocument, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type TwoHeroesQueryHookResult = ReturnType; export type TwoHeroesLazyQueryHookResult = ReturnType; diff --git a/dev-test/test-message/types.tsx b/dev-test/test-message/types.tsx index 84f13e6cf..68bb6a6b8 100644 --- a/dev-test/test-message/types.tsx +++ b/dev-test/test-message/types.tsx @@ -140,6 +140,14 @@ export function useGetMessagesLazyQuery( options, ); } +export function useGetMessagesSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; +export function useGetMessagesSuspenseQuery( + baseOptions?: + | Apollo.SkipToken + | Apollo.SuspenseQueryHookOptions, +): Apollo.UseSuspenseQueryResult; export function useGetMessagesSuspenseQuery( baseOptions?: | Apollo.SkipToken @@ -150,7 +158,9 @@ export function useGetMessagesSuspenseQuery( return Apollo.useSuspenseQuery( Operations.GetMessages, options, - ); + ) as + | Apollo.UseSuspenseQueryResult + | Apollo.UseSuspenseQueryResult; } export type GetMessagesQueryHookResult = ReturnType; export type GetMessagesLazyQueryHookResult = ReturnType;