diff options
Diffstat (limited to 'src/services/graphql')
| -rw-r--r-- | src/services/graphql/queries.ts | 19 | 
1 files changed, 19 insertions, 0 deletions
| 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<Slug[]> => {    const response = await fetchApi<AllThematicsSlug>(query, null);    return response.thematics.nodes;  }; + +export const getAllThematics = async (): Promise<ThematicPreview[]> => { +  const query = gql` +    query AllThematics { +      thematics { +        nodes { +          databaseId +          slug +          title +        } +      } +    } +  `; + +  const response = await fetchApi<AllThematics>(query, null); +  return response.thematics.nodes; +}; | 
