Skip to content

Commit cc82f81

Browse files
committed
1 parent 554820d commit cc82f81

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

examples/graphql/apollo.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
client: {
3+
service: {
4+
name: 'jsonplaceholder',
5+
url: 'https://graphqlzero.almansi.me/api',
6+
}
7+
}
8+
}

examples/graphql/src/pages/tasks-list/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ const QUERY = loader("./query.gql");
99

1010
const TasksList = () => {
1111
const { data, error, loading } = useFetch<Task[]>("todos");
12-
const query = useQuery(QUERY);
12+
const { data: query } = useQuery(QUERY);
1313

1414
useEffect(() => {
1515
// console.log("#", query.data);
16-
if (query.data) {
16+
if (query) {
1717
// @ts-ignore
18-
console.table(query.data.todos.data.map(({ __typename, ...details }) => ({
18+
console.table(query.todos.data.map(({ __typename, ...details }) => ({
1919
id: details.id,
2020
title: details.title,
2121
user: details.user.name,

0 commit comments

Comments
 (0)