summaryrefslogtreecommitdiffstats
path: root/src/ts/types/blog.ts
blob: 05bdd1f9b33e2e01a5f34cd26c2265e0b9adaeb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { PageInfo, Slug } from './app';
import { ArticlePreview, RawArticlePreview } from './articles';
import { ThematicPreview, TopicPreview } from './taxonomies';

export type PostsList = {
  posts: ArticlePreview[];
  pageInfo: PageInfo;
};

export type PostsListEdges = {
  cursor: string;
  node: RawArticlePreview;
};

export type RawPostsList = {
  posts: {
    edges: PostsListEdges[];
    pageInfo: PageInfo;
  };
};

export type LastPostCursor = {
  posts: {
    pageInfo: {
      endCursor: string;
    };
  };
};

export type AllPostsSlug = {
  posts: {
    nodes: Slug[];
  };
};

export type BlogPageProps = {
  allThematics: ThematicPreview[];
  allTopics: TopicPreview[];
  posts: PostsList;
  totalPosts: number;
};