diff --git a/src/graphql/client/core.ts b/src/graphql/client/core.ts index 008915f3..f376390e 100644 --- a/src/graphql/client/core.ts +++ b/src/graphql/client/core.ts @@ -30,6 +30,7 @@ import unfollowMutation from '../mutation/core/unfollow' import shoutLoad from '../query/core/article-load' import shoutsLoadBy from '../query/core/articles-load-by' import draftsLoad from '../query/core/articles-load-drafts' +import getMyShout from '../query/core/article-my' import myFeed from '../query/core/articles-load-feed' import loadShoutsTopRandom from '../query/core/articles-load-random-top' import articlesLoadRandomTopic from '../query/core/articles-load-random-topic' @@ -41,7 +42,6 @@ import authorFollows from '../query/core/author-follows' import authorId from '../query/core/author-id' import authorsAll from '../query/core/authors-all' import authorsLoadBy from '../query/core/authors-load-by' -import mySubscriptions from '../query/core/my-followed' import reactionsLoadBy from '../query/core/reactions-load-by' import topicBySlug from '../query/core/topic-by-slug' import topicsAll from '../query/core/topics-all' @@ -206,10 +206,10 @@ export const apiClient = { }, getMyShout: async (shout_id: number) => { - const resp = await apiClient.private.query(shoutLoad, { shout_id }).toPromise() + const resp = await apiClient.private.query(getMyShout, { shout_id }).toPromise() if (resp.error) console.error(resp) - return resp.data.get_shout + return resp.data.get_my_shout }, getShouts: async (options: LoadShoutsOptions) => { diff --git a/src/graphql/query/core/article-my.ts b/src/graphql/query/core/article-my.ts new file mode 100644 index 00000000..1399efe0 --- /dev/null +++ b/src/graphql/query/core/article-my.ts @@ -0,0 +1,50 @@ +import { gql } from '@urql/core' + +export default gql` + query GetMyShout($shout_id: Int!) { + get_my_shout(shout_id: $shout_id) { + id + title + lead + description + subtitle + slug + layout + cover + cover_caption + body + media + updated_by { + id + name + slug + pic + created_at + } + # community + main_topic + topics { + id + title + body + slug + stat { + shouts + authors + followers + } + } + authors { + id + name + slug + pic + created_at + } + created_at + updated_at + published_at + featured_at + } + } +` diff --git a/src/graphql/query/core/articles-load-drafts.ts b/src/graphql/query/core/articles-load-drafts.ts index ae425df4..f81d0a2f 100644 --- a/src/graphql/query/core/articles-load-drafts.ts +++ b/src/graphql/query/core/articles-load-drafts.ts @@ -23,13 +23,6 @@ export default gql` followers } } - created_by { - id - name - slug - pic - created_at - } authors { id name