Skip to content

Commit 75346de

Browse files
committed
fix query and mutation docs examples
1 parent 0ffbe14 commit 75346de

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/examples/python/use-mutation-query-refetch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def submit_event(event):
2626
elif item_query.error or not item_query.data:
2727
rendered_items = html.h2("Error when loading!")
2828
else:
29-
rendered_items = html.ul(html.li(item, key=item) for item in item_query.data)
29+
rendered_items = html.ul(html.li(item, key=item.pk) for item in item_query.data)
3030

3131
# Handle all possible mutation states
3232
if item_mutation.loading:

docs/examples/python/use-query.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def todo_list():
1717
elif item_query.error or not item_query.data:
1818
rendered_items = html.h2("Error when loading!")
1919
else:
20-
rendered_items = html.ul([html.li(item, key=item) for item in item_query.data])
20+
rendered_items = html.ul(
21+
[html.li(item, key=item.pk) for item in item_query.data]
22+
)
2123

2224
return html.div("Rendered items: ", rendered_items)

0 commit comments

Comments
 (0)