From b8eb008dd5927fb736e56699637f5f8549965eae Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 6 Dec 2023 18:20:54 +0100 Subject: refactor(hooks): replace useGithubApi with useGithubRepoMeta * use GraphQL API instead of REST (the inconvenient however is that we now need an authorization token...) * move fetcher in services * add tests * mock response using MSW --- tests/msw/schema/index.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/msw/schema/index.ts') diff --git a/tests/msw/schema/index.ts b/tests/msw/schema/index.ts index 3763616..c818d50 100644 --- a/tests/msw/schema/index.ts +++ b/tests/msw/schema/index.ts @@ -36,3 +36,20 @@ export const schema = addResolversToSchema({ schema: schemaFromTypes, resolvers, }); + +export const githubSchema = buildSchema(` +scalar DateTime + +type Repository { + createdAt: DateTime! + stargazerCount: Int! + updatedAt: DateTime! +} + +type Query { + repository( + followRenames: Boolean = true + name: String! + owner: String! + ): Repository +}`); -- cgit v1.2.3