diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-28 17:49:26 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-28 18:04:24 +0100 |
| commit | 29a1dec4de0aa7ba64ef068a83b1b8589fbc3ad0 (patch) | |
| tree | 8db871542e878e9fdf589bccd1be7b5ed1378f72 /tests/msw/schema | |
| parent | f564d181bc428e25a02bf1d98c4449a6b3eb8e9e (diff) | |
fix(services,types): make queries and types coherent for Topic
* some nodes was missing in topicQuery
* a node was mispelled in topicsListQuery
* add tests for all topics fetchers
Diffstat (limited to 'tests/msw/schema')
| -rw-r--r-- | tests/msw/schema/types/index.ts | 12 | ||||
| -rw-r--r-- | tests/msw/schema/types/topic.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 c570033..ada7f2c 100644 --- a/tests/msw/schema/types/index.ts +++ b/tests/msw/schema/types/index.ts @@ -38,6 +38,18 @@ const rootQueryType = `type Query { last: Int where: RootQueryToThematicConnectionWhereArgs ): RootQueryToThematicConnection + topic( + asPreview: Boolean + id: ID! + idType: TopicIdType + ): Topic + topics( + after: String + before: String + first: Int + last: Int + where: RootQueryToTopicConnectionWhereArgs + ): RootQueryToTopicConnection }`; export const types = [ diff --git a/tests/msw/schema/types/topic.types.ts b/tests/msw/schema/types/topic.types.ts index ba9abb7..2d54653 100644 --- a/tests/msw/schema/types/topic.types.ts +++ b/tests/msw/schema/types/topic.types.ts @@ -1,4 +1,11 @@ -export const topicTypes = `union Topic_Acftopics_PostsInTopic = Post +export const topicTypes = `enum TopicIdType { + DATABASE_ID + ID + SLUG + URI +} + +union Topic_Acftopics_PostsInTopic = Post type Topic_Acftopics { officialWebsite: String @@ -16,6 +23,32 @@ type Topic { seo: PostTypeSEO slug: String title(format: PostObjectFieldFormatEnum): String +} + +input RootQueryToTopicConnectionWhereArgs { + authorName: String + orderby: [PostObjectsConnectionOrderbyInput] + search: String + title: String +} + +type RootQueryToTopicConnectionPageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String + total: Int +} + +type RootQueryToTopicConnectionEdge { + cursor: String + node: Topic! +} + +type RootQueryToTopicConnection { + edges: [RootQueryToTopicConnectionEdge!]! + nodes: [Topic!]! + pageInfo: RootQueryToTopicConnectionPageInfo! }`; // cSpell:ignore Acftopics |
