diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-12-24 12:31:07 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-12-24 12:31:07 +0100 |
| commit | 3d65cb04707cf3af11885995fd1110a5971d8b00 (patch) | |
| tree | 7499ab3483d59138d9b421902ab4d282ea534b8f /src/lib/data | |
| parent | 6ccc6f60fc85e665c8a07a169efbe8d09c9d9e8e (diff) | |
Diffstat (limited to 'src/lib/data')
| -rw-r--r-- | src/lib/data/queries.ts | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/lib/data/queries.ts b/src/lib/data/queries.ts new file mode 100644 index 0000000..7364c0f --- /dev/null +++ b/src/lib/data/queries.ts @@ -0,0 +1,90 @@ +import { gql } from '@apollo/client/core'; + +export const GET_FORUMS = gql` + query GetForums { + forums { + id + glyph + label + position + } + } +`; + +export const GET_FORUM = gql` + query GetForum($id: ID!) { + forum(id: $id) { + id + glyph + label + position + topics { + id + title + updated_at + ttl + } + } + } +`; + +export const GET_TAG = gql` + query GetTag($id: ID!) { + tag(id: $id) { + id + topics { + id + title + updated_at + ttl + } + } + } +`; + +export const GET_TOPIC = gql` + query GetTopic($id: ID!) { + topic(id: $id) { + id + title + updated_at + ttl + forum { + id + glyph + label + } + tags { + id + weight + } + posts { + id + text + created_at + author { + id + handle + } + } + } + } +`; + +export const GET_POST = gql` + query GetPost($id: ID!) { + post(id: $id) { + id + text + created_at + author { + id + handle + } + topic { + id + title + } + } + } +`; |