diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-28 16:18:03 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-28 18:04:24 +0100 |
| commit | f564d181bc428e25a02bf1d98c4449a6b3eb8e9e (patch) | |
| tree | 6057a1e3a419957fb32d1a08160d5d746e54bc04 /tests/msw/schema/types | |
| parent | 180134883b281883246fc9909b1d494363861144 (diff) | |
fix(services,types): make coherent Thematic type and query
* some nodes was queried but missing in the Thematic type and
vice versa, it is now fixed
* add tests for all thematics fetchers
Diffstat (limited to 'tests/msw/schema/types')
| -rw-r--r-- | tests/msw/schema/types/index.ts | 12 | ||||
| -rw-r--r-- | tests/msw/schema/types/thematic.types.ts | 35 |
2 files changed, 46 insertions, 1 deletions
diff --git a/tests/msw/schema/types/index.ts b/tests/msw/schema/types/index.ts index c34cacd..c570033 100644 --- a/tests/msw/schema/types/index.ts +++ b/tests/msw/schema/types/index.ts @@ -26,6 +26,18 @@ const rootQueryType = `type Query { last: Int where: RootQueryToPostConnectionWhereArgs ): RootQueryToPostConnection + thematic( + asPreview: Boolean + id: ID! + idType: ThematicIdType + ): Thematic + thematics( + after: String + before: String + first: Int + last: Int + where: RootQueryToThematicConnectionWhereArgs + ): RootQueryToThematicConnection }`; export const types = [ diff --git a/tests/msw/schema/types/thematic.types.ts b/tests/msw/schema/types/thematic.types.ts index afa95c9..2af4f9a 100644 --- a/tests/msw/schema/types/thematic.types.ts +++ b/tests/msw/schema/types/thematic.types.ts @@ -1,4 +1,11 @@ -export const thematicTypes = `union Thematic_Acfthematics_PostsInThematic = Post +export const thematicTypes = `enum ThematicIdType { + DATABASE_ID + ID + SLUG + URI +} + +union Thematic_Acfthematics_PostsInThematic = Post type Thematic_Acfthematics { postsInThematic: [Thematic_Acfthematics_PostsInThematic] @@ -15,6 +22,32 @@ type Thematic { seo: PostTypeSEO slug: String title(format: PostObjectFieldFormatEnum): String +} + +input RootQueryToThematicConnectionWhereArgs { + authorName: String + orderby: [PostObjectsConnectionOrderbyInput] + search: String + title: String +} + +type RootQueryToThematicConnectionPageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String + total: Int +} + +type RootQueryToThematicConnectionEdge { + cursor: String + node: Thematic! +} + +type RootQueryToThematicConnection { + edges: [RootQueryToThematicConnectionEdge!]! + nodes: [Thematic!]! + pageInfo: RootQueryToThematicConnectionPageInfo! }`; // cSpell:ignore Acfthematics |
