Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Dec 9, 2020
1 parent be1f9ad commit cb96531
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/useQuery.md → docs/api/useQuery.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
id: useQuery
title: useQuery
group:
title: API
---

```js
Expand Down
18 changes: 17 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Introduction
```typescript
function Todo() {
const { data, status } = useQuery(
graphql`
query MyQuery($limit: Int) {
todos(order_by: { updated_at: desc }, limit: $limit) {
id
}
}
`,
{
variables: { limit: 3 },
}
);

return <pre>{JSON.stringify(data, null, 2)}</pre>;
}

<API src="../src/hooks/useQuery.tsx"></API>
```

```jsx
import React from "react";
Expand Down

0 comments on commit cb96531

Please sign in to comment.