From b4e12398fbeb642c12649dcccdf4d5cdefa471e3 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 7 Jan 2022 12:01:08 +0100 Subject: chore: add a widget to list all blog thematics --- src/services/graphql/queries.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/services') diff --git a/src/services/graphql/queries.ts b/src/services/graphql/queries.ts index afc9f69..26a7869 100644 --- a/src/services/graphql/queries.ts +++ b/src/services/graphql/queries.ts @@ -3,11 +3,13 @@ import { Article, PostBy } from '@ts/types/articles'; import { AllPostsSlug, PostsList, RawPostsList } from '@ts/types/blog'; import { AllSubjectsSlug, + AllThematics, AllThematicsSlug, Subject, SubjectBy, Thematic, ThematicBy, + ThematicPreview, } from '@ts/types/taxonomies'; import { getFormattedPost, @@ -449,3 +451,20 @@ export const getAllThematicsSlug = async (): Promise => { const response = await fetchApi(query, null); return response.thematics.nodes; }; + +export const getAllThematics = async (): Promise => { + const query = gql` + query AllThematics { + thematics { + nodes { + databaseId + slug + title + } + } + } + `; + + const response = await fetchApi(query, null); + return response.thematics.nodes; +}; -- cgit v1.2.3