]> git.r.bdr.sh - rbdr/forum/blobdiff - src/data/queries.js
Use routify and GraphQL server
[rbdr/forum] / src / data / queries.js
diff --git a/src/data/queries.js b/src/data/queries.js
new file mode 100644 (file)
index 0000000..de223cb
--- /dev/null
@@ -0,0 +1,29 @@
+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
+      }
+    }
+  }
+`;