Skip to content

Commit 24b3f33

Browse files
committed
Update example
1 parent cfbd3f9 commit 24b3f33

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

docs/source/development-testing/static-typing.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,12 @@ const GET_ROCKET_INVENTORY: TypedDocumentNode<
636636
`;
637637

638638
function MyComponent() {
639-
const { data } = useQuery(GET_ROCKET_INVENTORY);
639+
const { data } = useQuery(GET_ROCKET_INVENTORY, {
640+
// ^? GetRocketInventoryQuery | undefined;
641+
variables: { year: 2025 },
642+
});
640643

641-
// `data` is properly typed!
644+
// ...
642645
}
643646
```
644647

@@ -717,8 +720,11 @@ import { useQuery } from "@apollo/client/react";
717720
import { getRocketInventoryQuery } from "./my-component.generated";
718721

719722
function MyComponent() {
720-
const { data } = useQuery(getRocketInventoryQuery);
723+
const { data } = useQuery(getRocketInventoryQuery, {
724+
// ^? GetRocketInventoryQuery | undefined;
725+
variables: { year: 2025 },
726+
});
721727

722-
// `data` is properly typed!
728+
// ...
723729
}
724730
```

0 commit comments

Comments
 (0)