From cd6ecce30598d3fe630cac41bcf0b82115fc3fef Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Mon, 20 Feb 2023 15:59:16 +0300 Subject: [PATCH] new gqls --- src/graphql/mutation/article-from-draft.ts | 28 ++++++++++++ .../query/{my-collabs.ts => my-drafts.ts} | 4 +- src/graphql/query/my-feed.ts | 43 +++++++++++++++++++ 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 src/graphql/mutation/article-from-draft.ts rename src/graphql/query/{my-collabs.ts => my-drafts.ts} (80%) create mode 100644 src/graphql/query/my-feed.ts diff --git a/src/graphql/mutation/article-from-draft.ts b/src/graphql/mutation/article-from-draft.ts new file mode 100644 index 00000000..882e49f0 --- /dev/null +++ b/src/graphql/mutation/article-from-draft.ts @@ -0,0 +1,28 @@ +import { gql } from '@urql/core' + +export default gql` + mutation ShoutFromDraftMutation($draft: Int!) { + draftToShout(draft: $draft) { + error + shout { + _id: slug + slug + title + subtitle + body + topics { + # id + title + slug + } + authors { + id + name + slug + userpic + caption + } + } + } + } +` diff --git a/src/graphql/query/my-collabs.ts b/src/graphql/query/my-drafts.ts similarity index 80% rename from src/graphql/query/my-collabs.ts rename to src/graphql/query/my-drafts.ts index bf78e8f8..b5dd8c1a 100644 --- a/src/graphql/query/my-collabs.ts +++ b/src/graphql/query/my-drafts.ts @@ -1,8 +1,8 @@ import { gql } from '@urql/core' export default gql` - query GetCollabsQuery { - getCollabs { + query MyDraftsQuery { + loadDrafts { authors { id slug diff --git a/src/graphql/query/my-feed.ts b/src/graphql/query/my-feed.ts new file mode 100644 index 00000000..dee34894 --- /dev/null +++ b/src/graphql/query/my-feed.ts @@ -0,0 +1,43 @@ +import { gql } from '@urql/core' + +export default gql` + query MyFeedQuery($options: LoadShoutsOptions) { + myFeed(options: $options) { + _id: slug + id + title + subtitle + slug + layout + cover + # community + mainTopic + topics { + # id + title + body + slug + stat { + _id: shouts + shouts + authors + followers + } + } + authors { + id + name + slug + userpic + } + createdAt + publishedAt + stat { + _id: viewed + viewed + reacted + rating + } + } + } +`