@@ -323,10 +323,22 @@ Like `useQuery`, you provide `useMutation` a `TypedDocumentNode`. This adds the
323323``` tsx
324324import { gql , TypedDocumentNode } from " @apollo/client" ;
325325import { useMutation } from " @apollo/client/react" ;
326- import {
327- SaveRocketMutation ,
328- SaveRocketMutationVariables ,
329- } from " @/types/__generated__/graphql" ;
326+
327+ // In a real application, consider generating types from your schema
328+ // instead of writing them by hand
329+ type SaveRocketMutation = {
330+ saveRocket: {
331+ model: string ;
332+ } | null ;
333+ };
334+
335+ type SaveRocketMutationVariables = {
336+ rocket: {
337+ model: string ;
338+ year: number ;
339+ stock: number ;
340+ };
341+ };
330342
331343const SAVE_ROCKET: TypedDocumentNode <
332344 SaveRocketMutation ,
@@ -459,10 +471,16 @@ Like `useQuery`, you provide `useSubscription` a `TypedDocumentNode`. This adds
459471``` tsx
460472import { gql , TypedDocumentNode } from " @apollo/client" ;
461473import { useSubscription } from " @apollo/client/react" ;
462- import {
463- GetLatestNewsSubscription ,
464- GetLatestNewsSubscriptionVariables ,
465- } from " @/types/__generated__/graphql" ;
474+
475+ // In a real application, consider generating types from your schema
476+ // instead of writing them by hand
477+ type GetLatestNewsSubscription = {
478+ latestNews: {
479+ content: string ;
480+ };
481+ };
482+
483+ type GetLatestNewsSubscriptionVariables = Record <string , never >;
466484
467485const LATEST_NEWS: TypedDocumentNode <
468486 GetLatestNewsSubscription ,
0 commit comments