From 29a1dec4de0aa7ba64ef068a83b1b8589fbc3ad0 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 28 Nov 2023 17:49:26 +0100 Subject: 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 --- tests/msw/schema/types/index.ts | 12 ++++++++++++ tests/msw/schema/types/topic.types.ts | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) (limited to 'tests/msw/schema/types') 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 -- cgit v1.2.3