diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-24 15:38:37 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-24 15:38:37 +0100 |
| commit | ef7912256cb4765d553b002c24b9752c2d5096ac (patch) | |
| tree | 59b574dbda693dc5f1b2605272a6eff3b23802f2 /src/services/graphql/queries.ts | |
| parent | fe5d74a864ddd1429b0753a3984c45b2392176d2 (diff) | |
| parent | 0bb6411ee9fce02c2e5680f2be5740a1bbb508ad (diff) | |
feat: use mdx for pages
Diffstat (limited to 'src/services/graphql/queries.ts')
| -rw-r--r-- | src/services/graphql/queries.ts | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/services/graphql/queries.ts b/src/services/graphql/queries.ts index 652caa1..a40446e 100644 --- a/src/services/graphql/queries.ts +++ b/src/services/graphql/queries.ts @@ -1,8 +1,6 @@ import { Slug } from '@ts/types/app'; import { Article, PostBy } from '@ts/types/articles'; import { AllPostsSlug, PostsList, RawPostsList } from '@ts/types/blog'; -import { HomePage, HomePageBy } from '@ts/types/homepage'; -import { Page, PageBy } from '@ts/types/pages'; import { AllSubjectsSlug, AllThematicsSlug, @@ -12,7 +10,6 @@ import { ThematicBy, } from '@ts/types/taxonomies'; import { - getFormattedPage, getFormattedPost, getFormattedPostPreview, getFormattedSubject, @@ -235,50 +232,6 @@ export const getPostBySlug = async (slug: string): Promise<Article> => { }; //============================================================================== -// Pages query -//============================================================================== - -export const getHomePage = async (): Promise<HomePage> => { - const query = gql` - query HomePage { - nodeByUri(uri: "/") { - ... on Page { - id - content - } - } - } - `; - - const response = await fetchApi<HomePageBy>(query, null); - const homepage = response.nodeByUri; - - return homepage; -}; - -export const getPageByUri = async (slug: string): Promise<Page> => { - const query = gql` - query PageByUri($slug: String!) { - pageBy(uri: $slug) { - contentParts { - afterMore - beforeMore - } - date - modified - title - } - } - `; - - const variables = { slug }; - const response = await fetchApi<PageBy>(query, variables); - const page = getFormattedPage(response.pageBy); - - return page; -}; - -//============================================================================== // Subject query //============================================================================== |
