diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-08-20 21:39:51 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-08-20 21:39:51 +0200 |
| commit | a0d00743cbbdb77b27c1a3d5711407ffed5befac (patch) | |
| tree | f4caab160daf6b93c74d60ab93edd265c8edb158 /src/ts/types/raw-data.ts | |
| parent | 46b158bf9d2f7fa9cc253915151e0b53c052a444 (diff) | |
refactor(types): move and rename GraphQL types
The api file in services was not really readable. So I move the types
and I also rewrite a little the fetch function.
I also rename most of the type to avoid conflict with preexisting
types (like Node) and to keep consistency.
Diffstat (limited to 'src/ts/types/raw-data.ts')
| -rw-r--r-- | src/ts/types/raw-data.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ts/types/raw-data.ts b/src/ts/types/raw-data.ts index dc3db90..ae7f7c6 100644 --- a/src/ts/types/raw-data.ts +++ b/src/ts/types/raw-data.ts @@ -2,8 +2,8 @@ * Types for raw data coming from GraphQL API. */ -import { NodeResponse, PageInfo } from '@services/graphql/api'; import { ContentKind } from './app'; +import { GraphQLNode, GraphQLPageInfo } from './graphql/generics'; export type ACFPosts = { postsInThematic?: RawThematicPreview[]; @@ -37,7 +37,7 @@ export type RawAuthor<T extends ContentKind> = { export type RawComment = { approved: boolean; - author: NodeResponse<RawAuthor<'comment'>>; + author: GraphQLNode<RawAuthor<'comment'>>; content: string; databaseId: number; date: string; @@ -65,11 +65,11 @@ export type RawArticlePreview = Pick< >; export type RawPage = { - author?: NodeResponse<RawAuthor<'page'>>; + author?: GraphQLNode<RawAuthor<'page'>>; contentParts: ContentParts; databaseId: number; date: string; - featuredImage: NodeResponse<RawCover> | null; + featuredImage: GraphQLNode<RawCover> | null; info: Info; modified: string; seo?: RawSEO; @@ -101,5 +101,5 @@ export type RawTopicPreview = Pick< >; export type TotalItems = { - pageInfo: Pick<PageInfo, 'total'>; + pageInfo: Pick<GraphQLPageInfo, 'total'>; }; |
