From d5c90c09a720417309e618f82adaae4660c169af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SnO=E2=82=82WMaN?= Date: Fri, 8 Dec 2023 19:47:37 +0900 Subject: [PATCH] =?UTF-8?q?`Query`=E3=81=A8`Mutation`=E3=81=A8root?= =?UTF-8?q?=E3=81=AEResolver=E3=82=92=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0=20(#1045)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * `Query`と`Mutation`とrootのResolverをリファクタリング Fixes #1042 Fixes #1036 * fx --- src/{resolvers => }/common.graphql | 0 src/index.ts | 2 +- src/{resolvers => }/interfaces.graphql | 0 src/mutation.ts | 68 ++++++++ src/query.ts | 124 +++++++++++++++ src/{resolvers/index.ts => resolvers.ts} | 190 +++++++++++------------ src/resolvers/Mutation/index.ts | 68 -------- src/resolvers/Query/index.ts | 112 ------------- 8 files changed, 288 insertions(+), 276 deletions(-) rename src/{resolvers => }/common.graphql (100%) rename src/{resolvers => }/interfaces.graphql (100%) create mode 100644 src/mutation.ts create mode 100644 src/query.ts rename src/{resolvers/index.ts => resolvers.ts} (61%) delete mode 100644 src/resolvers/Mutation/index.ts delete mode 100644 src/resolvers/Query/index.ts diff --git a/src/resolvers/common.graphql b/src/common.graphql similarity index 100% rename from src/resolvers/common.graphql rename to src/common.graphql diff --git a/src/index.ts b/src/index.ts index 54efab08..902cd181 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,7 @@ import { mkNeo4jService } from "./Neo4j/Neo4j.service.js"; import { mkNicovideoRegistrationRequestService } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequest.service.js"; import { mkNicovideoRegistrationRequestEventService } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestEvent.service.js"; import { NicochuuService } from "./protobuf/nicochuu_connect.js"; -import { makeResolvers } from "./resolvers/index.js"; +import { makeResolvers } from "./resolvers.js"; import { CurrentUser, ServerContext, UserContext } from "./resolvers/types.js"; import typeDefs from "./schema.graphql"; import { mkSoundcloudMADSourceService } from "./SoundcloudMADSource/SoundcloudMADSource.service.js"; diff --git a/src/resolvers/interfaces.graphql b/src/interfaces.graphql similarity index 100% rename from src/resolvers/interfaces.graphql rename to src/interfaces.graphql diff --git a/src/mutation.ts b/src/mutation.ts new file mode 100644 index 00000000..44ff2e49 --- /dev/null +++ b/src/mutation.ts @@ -0,0 +1,68 @@ +/* eslint sort-keys: 2 */ + +import { mkRegisterBilibiliMADResolver } from "./BilibiliMADSource/registerBilibiliMAD.resolver.js"; +import { mkRequestBilibiliRegistrationResolver } from "./BilibiliRegistrationRequest/requestBilibiliRegistration.resolver.js"; +import { resolverRejectRequestNicovideoRegistration } from "./NicovideoRegistrationRequest/rejectNicovideoRegistrationRequest.resolver.js"; +import { resolverRequestNicovideoRegistration } from "./NicovideoRegistrationRequest/requestNicovideoRegistration.resolver.js"; +import { resolverRegisterVideoFromNicovideo } from "./NicovideoVideoSource/registerVideoFromNicovideo.resolver.js"; +import { type Resolvers } from "./resolvers/graphql.js"; +import { addMylistToMylistGroup } from "./resolvers/Mutation/addMylistToMylistGroup/addMylistToMylistGroup.js"; +import { addSemitagToVideo } from "./resolvers/Mutation/addSemitagToVideo/addSemitagToVideo.js"; +import { addVideoToMylist } from "./resolvers/Mutation/addVideoToMylist/addVideoToMylist.js"; +import { resolverChangeMylistShareRange } from "./resolvers/Mutation/changeMylistShareRange/resolver.js"; +import { resolverChangeUserDisplayName } from "./resolvers/Mutation/changeUserDisplayName/resolver.js"; +import { createMylist } from "./resolvers/Mutation/createMylist/createMylist.js"; +import { createMylistGroup } from "./resolvers/Mutation/createMylistGroup/createMylistGroup.js"; +import { resolverLikeVideo } from "./resolvers/Mutation/likeVideo/resolver.js"; +import { resolverRejectSemitag } from "./resolvers/Mutation/rejectSemitag/resolver.js"; +import { removeVideoFromMylist } from "./resolvers/Mutation/removeVideoFromMylist/removeVideoFromMylist.js"; +import { resolverResolveSemitag } from "./resolvers/Mutation/resolveSemitag/resolver.js"; +import { resolverUndoLikeVideo } from "./resolvers/Mutation/undoLikeVideo/resolver.js"; +import { resolverWatchNotifications } from "./resolvers/Mutation/watchNotifications/resolver.js"; +import { ResolverDeps } from "./resolvers/types.js"; +import { mkRegisterSoundcloudMADResolver } from "./SoundcloudMADSource/registerSoundcloudMAD.resolver.js"; +import { mkRequestSoundcloudRegistrationResolver } from "./SoundcloudRegistrationRequest/requestSoundcloudRegistration.resolver.js"; +import { resolverAddTagToVideo } from "./Tag/addTagToVideo.resolver.js"; +import { resolverExplicitizeTagParent } from "./Tag/explicitizeTagParent.resolver.js"; +import { resolverImplicitizeTagParent } from "./Tag/implicitizeTagParent.resolver.js"; +import { registerCategoryTag } from "./Tag/registerCategoryTag.resolver.js"; +import { resolverRegisterCategoryTagTyping } from "./Tag/registerCategoryTagTyping.resolver.js"; +import { resolverRegisterTag } from "./Tag/registerTag.resolver.js"; +import { resolverRegisterTagParentRelation } from "./Tag/registerTagParentRelation.resolver.js"; +import { resolverRemoveTagFromVideo } from "./Tag/removeTagFromVideo.resolver.js"; +import { mkRequestYoutubeRegistrationResolver } from "./YoutubeRegistrationRequest/requestYoutubeRegistration.resolver.js"; +import { resolverRegisterVideoFromYoutube } from "./YoutubeVideoSource/registerVideoFromYoutube.resolver.js"; + +export const resolveMutation = (deps: ResolverDeps) => + ({ + addMylistToMylistGroup: addMylistToMylistGroup(deps), + addSemitagToVideo: addSemitagToVideo(deps), + addTagToVideo: resolverAddTagToVideo(deps), + addVideoToMylist: addVideoToMylist(deps), + changeMylistShareRange: resolverChangeMylistShareRange(deps), + changeUserDisplayName: resolverChangeUserDisplayName(deps), + createMylist: createMylist(deps), + createMylistGroup: createMylistGroup(deps), + explicitizeTagParent: resolverExplicitizeTagParent(deps), + implicitizeTagParent: resolverImplicitizeTagParent(deps), + likeVideo: resolverLikeVideo(deps), + registerBilibiliMAD: mkRegisterBilibiliMADResolver(deps), + registerCategoryTag: registerCategoryTag(deps), + registerCategoryTagTyping: resolverRegisterCategoryTagTyping(deps), + registerSoundcloudMAD: mkRegisterSoundcloudMADResolver(deps), + registerTag: resolverRegisterTag(deps), + registerTagParentRelation: resolverRegisterTagParentRelation(deps), + registerVideoFromNicovideo: resolverRegisterVideoFromNicovideo(deps), + registerVideoFromYoutube: resolverRegisterVideoFromYoutube(deps), + rejectNicovideoRegistrationRequest: resolverRejectRequestNicovideoRegistration(deps), + rejectSemitag: resolverRejectSemitag(deps), + removeTagFromVideo: resolverRemoveTagFromVideo(deps), + removeVideoFromMylist: removeVideoFromMylist(deps), + requestBilibiliRegistration: mkRequestBilibiliRegistrationResolver(deps), + requestNicovideoRegistration: resolverRequestNicovideoRegistration(deps), + requestSoundcloudRegistration: mkRequestSoundcloudRegistrationResolver(deps), + requestYoutubeRegistration: mkRequestYoutubeRegistrationResolver(deps), + resovleSemitag: resolverResolveSemitag(deps), + undoLikeVideo: resolverUndoLikeVideo(deps), + watchNotifications: resolverWatchNotifications(deps), + }) satisfies Required; diff --git a/src/query.ts b/src/query.ts new file mode 100644 index 00000000..fcffbe3d --- /dev/null +++ b/src/query.ts @@ -0,0 +1,124 @@ +/* eslint sort-keys: [2, "asc", {caseSensitive: false}] */ + +import { mkFindBilibiliMADSourceResolver } from "./BilibiliMADSource/findBilibiliMADSource.resolver.js"; +import { resolverGetBilibiliMADSource } from "./BilibiliMADSource/getBilibiliMADSource.resolver.js"; +import { mkFindBilibiliRegistrationRequestByUrlResolver } from "./BilibiliRegistrationRequest/findBilibiliRegistrationRequestBySourceId.resolver.js"; +import { resolverFindUncheckedBilibiliRegistrationRequests } from "./BilibiliRegistrationRequest/findUncheckedBilibiliRegistrationRequests.resolver.js"; +import { resolverGetBilibiliRegistrationRequest } from "./BilibiliRegistrationRequest/getBilibiliRegistrationRequest.resolver.js"; +import { resolverFetchBilibili } from "./FetchExternal/fetchBilibili.resolver.js"; +import { fetchNicovideo } from "./FetchExternal/fetchNicovideo.js"; +import { mkFetchSoundcloudResolver } from "./FetchExternal/fetchSoundcloud.resolver.js"; +import { resolverFetchYoutube } from "./FetchExternal/fetchYoutube.js"; +import { mkListNicovideoBotRegistrationRequestsResolver } from "./NicovideoBotRegistrationRequest/listNicovideoBotRegistrationRequests.resolver.js"; +import { resolverFindNicovideoRegistrationRequest } from "./NicovideoRegistrationRequest/findNicovideoRegistrationRequest.resolver.js"; +import { findNicovideoRegistrationRequests } from "./NicovideoRegistrationRequest/findNicovideoRegistrationRequests.resolver.js"; +import { resolverFindUncheckedNicovideoRegistrationRequests } from "./NicovideoRegistrationRequest/findUncheckedNicovideoRegistrationRequests.resolver.js"; +import { resolverFindUncheckedNicovideoRegistrationRequestsByOffset } from "./NicovideoRegistrationRequest/findUncheckedNicovideoRegistrationRequestsByOffset.resolver.js"; +import { resolverGetNicovideoRegistrationRequest } from "./NicovideoRegistrationRequest/getNicovideoRegistrationRequest.js"; +import { resolverFindNicovideoVideoSource } from "./NicovideoVideoSource/findNicovideoVideoSource.resolver.js"; +import { getNicovideoVideoSource } from "./NicovideoVideoSource/getNicovideoVideoSource.resolver.js"; +import { type Resolvers } from "./resolvers/graphql.js"; +import { resolverFindMylist } from "./resolvers/Query/findMylist/findMylist.js"; +import { findSemitags } from "./resolvers/Query/findSemitags/findSemitags.js"; +import { getMylist } from "./resolvers/Query/getMylist/resolver.js"; +import { getMylistGroup } from "./resolvers/Query/getMylistGroup/resolver.js"; +import { getNotification } from "./resolvers/Query/getNotification/resolver.js"; +import { resolverGetSemitag } from "./resolvers/Query/getSemitag/resolver.js"; +import { resolverNotifications } from "./resolvers/Query/notifications/resolver.js"; +import { resolverWhoami } from "./resolvers/Query/whoami/resolver.js"; +import { ResolverDeps } from "./resolvers/types.js"; +import { mkFindSoundcloudMADSourceResolver } from "./SoundcloudMADSource/findSoundcloudMADSource.resolver.js"; +import { getSoundcloudMADSource } from "./SoundcloudMADSource/getSoundcloudMADSource.resolver.js"; +import { resolverFindSoundcloudRegistrationRequest } from "./SoundcloudRegistrationRequest/findSoundcloudRegistrationRequest.resolver.js"; +import { mkFindSoundcloudRegistrationRequestByUrlResolver } from "./SoundcloudRegistrationRequest/findSoundcloudRegistrationRequestByUrl.resolver.js"; +import { resolverFindUncheckedSoundcloudRegistrationRequests } from "./SoundcloudRegistrationRequest/findUncheckedSoundcloudRegistrationRequests.resolver.js"; +import { resolverGetSoundcloudRegistrationRequest } from "./SoundcloudRegistrationRequest/getSoundcloudRegistrationRequest.resolver.js"; +import { mkCountAllTagsResolver } from "./Tag/countAllTags.resolver.js"; +import { resolverFindTag } from "./Tag/findTag.resolver.js"; +import { resolverFindTagBySerial } from "./Tag/findTagBySerial.resolver.js"; +import { resolverFindTags } from "./Tag/findTags.resolver.js"; +import { resolverGetAllCategoryTag } from "./Tag/getAllCategoryTag.resolver.js"; +import { resolverGetAllTypeCategoryTag } from "./Tag/getAllTypeCategoryTag.resolver.js"; +import { resolverGetTag } from "./Tag/getTag.resolver.js"; +import { resolverSearchTags } from "./Tag/searchTags.resolver.js"; +import { mkShowTimelineResolver } from "./Timeline/showTimeline.resolver.js"; +import { resolverFindUser } from "./User/findUser.resolver.js"; +import { resolverGetUser } from "./User/getUser.resolver.js"; +import { mkViewerResolver } from "./User/viewer.resolver.js"; +import { mkCalcMadCountGrowthResolver } from "./Video/calcMadCountGrowth.resolver.js"; +import { mkCountAllMadsResolver } from "./Video/countAllMads.resolver.js"; +import { resolverFindMadBySerial } from "./Video/findMadBySerial.resolver.js"; +import { mkFindMadsByOffsetResolver } from "./Video/findMadsByOffset.resolver.js"; +import { resolverFindVideo } from "./Video/findVideo.resolver.js"; +import { resolverFindVideos } from "./Video/findVideos.resolver.js"; +import { resolverGetVideo } from "./Video/getVideo.resolver.js"; +import { resolverSearchVideos } from "./Video/searchVideos.resolver.js"; +import { resolverFindUncheckedYoutubeRegistrationRequests } from "./YoutubeRegistrationRequest/findUncheckedYoutubeRegistrationRequests.resolver.js"; +import { resolverFindYoutubeRegistrationRequest } from "./YoutubeRegistrationRequest/findYoutubeRegistrationRequest.resolver.js"; +import { resolverGetYoutubeRegistrationRequest } from "./YoutubeRegistrationRequest/getYoutubeRegistrationRequest.resolver.js"; +import { resolverFindYoutubeVideoSource } from "./YoutubeVideoSource/findYoutubeVideoSource.resolver.js"; +import { getYoutubeVideoSource } from "./YoutubeVideoSource/getYoutubeVideoSource.resolver.js"; + +export const resolveQuery = (deps: ResolverDeps) => + ({ + calcMadCountGrowth: mkCalcMadCountGrowthResolver(deps), + countAllMads: mkCountAllMadsResolver(deps), + countAllTags: mkCountAllTagsResolver(deps), + fetchBilibili: resolverFetchBilibili(deps), + fetchNicovideo: fetchNicovideo(), + fetchSoundcloud: mkFetchSoundcloudResolver(deps), + fetchYoutube: resolverFetchYoutube(), + findBilibiliMADSource: mkFindBilibiliMADSourceResolver(deps), + findBilibiliRegistrationRequestBySourceId: mkFindBilibiliRegistrationRequestByUrlResolver(deps), + findMadBySerial: resolverFindMadBySerial(deps), + findMadsByOffset: mkFindMadsByOffsetResolver({ + ...deps, + logger: deps.logger.child({ resolver: "Query.findMadsByOffset" }), + }), + findMylist: resolverFindMylist(deps), + findNicovideoRegistrationRequest: resolverFindNicovideoRegistrationRequest(deps), + findNicovideoRegistrationRequests: findNicovideoRegistrationRequests(deps), + findNicovideoVideoSource: resolverFindNicovideoVideoSource(deps), + findSemitags: findSemitags(deps), + findSoundcloudMADSource: mkFindSoundcloudMADSourceResolver(deps), + findSoundcloudRegistrationRequest: resolverFindSoundcloudRegistrationRequest(deps), + findSoundcloudRegistrationRequestByUrl: mkFindSoundcloudRegistrationRequestByUrlResolver(deps), + findTag: resolverFindTag(deps), + findTagBySerial: resolverFindTagBySerial(deps), + findTags: resolverFindTags(deps), + findUncheckedBilibiliRegistrationRequests: resolverFindUncheckedBilibiliRegistrationRequests(deps), + findUncheckedNicovideoRegistrationRequests: resolverFindUncheckedNicovideoRegistrationRequests(deps), + findUncheckedNicovideoRegistrationRequestsByOffset: + resolverFindUncheckedNicovideoRegistrationRequestsByOffset(deps), + findUncheckedSoundcloudRegistrationRequests: resolverFindUncheckedSoundcloudRegistrationRequests(deps), + findUncheckedYoutubeRegistrationRequests: resolverFindUncheckedYoutubeRegistrationRequests(deps), + findUser: resolverFindUser(deps), + findVideo: resolverFindVideo(deps), + findVideos: resolverFindVideos(deps), + findYoutubeRegistrationRequest: resolverFindYoutubeRegistrationRequest(deps), + findYoutubeVideoSource: resolverFindYoutubeVideoSource(deps), + getAllCategoryTag: resolverGetAllCategoryTag(deps), + getAllTypeCategoryTag: resolverGetAllTypeCategoryTag(deps), + getBilibiliMADSource: resolverGetBilibiliMADSource(deps), + getBilibiliRegistrationRequest: resolverGetBilibiliRegistrationRequest(deps), + getMylist: getMylist(deps), + getMylistGroup: getMylistGroup(deps), + getNicovideoRegistrationRequest: resolverGetNicovideoRegistrationRequest(deps), + getNicovideoVideoSource: getNicovideoVideoSource(deps), + getNotification: getNotification(deps), + getSemitag: resolverGetSemitag(deps), + getSoundcloudMADSource: getSoundcloudMADSource(deps), + getSoundcloudRegistrationRequest: resolverGetSoundcloudRegistrationRequest(deps), + getTag: resolverGetTag(deps), + getUser: resolverGetUser(deps), + getVideo: resolverGetVideo(deps), + getYoutubeRegistrationRequest: resolverGetYoutubeRegistrationRequest(deps), + getYoutubeVideoSource: getYoutubeVideoSource(deps), + listNicovideoBotRegistrationRequests: mkListNicovideoBotRegistrationRequestsResolver(deps), + notifications: resolverNotifications(deps), + searchTags: resolverSearchTags(deps), + searchVideos: resolverSearchVideos(deps), + showTimeline: mkShowTimelineResolver(deps), + viewer: mkViewerResolver({ ...deps }), + whoami: resolverWhoami(deps), + }) satisfies Required; diff --git a/src/resolvers/index.ts b/src/resolvers.ts similarity index 61% rename from src/resolvers/index.ts rename to src/resolvers.ts index 0db89943..a7a43eaf 100644 --- a/src/resolvers/index.ts +++ b/src/resolvers.ts @@ -2,153 +2,153 @@ import { DateTimeResolver } from "graphql-scalars"; -import { resolverBilibiliMADSource } from "../BilibiliMADSource/BilibiliMADSource.resolver.js"; -import { resolverBilibiliMADSourceCreateEvent } from "../BilibiliMADSource/BilibiliMADSourceEvent.resolver.js"; -import { resolverBilibiliMADSourceEventConnection } from "../BilibiliMADSource/BilibiliMADSourceEventConnection.resolver.js"; -import { resolverBilibiliRegistrationRequest } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequest.resolver.js"; -import { resolverBilibiliRegistrationRequestAccepting } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestAccepting.resolver.js"; -import { resolverBilibiliRegistrationRequestAcceptingNotification } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestAcceptingNotification.resolver.js"; -import { resolverBilibiliRegistrationRequestConnection } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestConnection.resolver.js"; +import { resolverBilibiliMADSource } from "./BilibiliMADSource/BilibiliMADSource.resolver.js"; +import { resolverBilibiliMADSourceCreateEvent } from "./BilibiliMADSource/BilibiliMADSourceEvent.resolver.js"; +import { resolverBilibiliMADSourceEventConnection } from "./BilibiliMADSource/BilibiliMADSourceEventConnection.resolver.js"; +import { resolverBilibiliRegistrationRequest } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequest.resolver.js"; +import { resolverBilibiliRegistrationRequestAccepting } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestAccepting.resolver.js"; +import { resolverBilibiliRegistrationRequestAcceptingNotification } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestAcceptingNotification.resolver.js"; +import { resolverBilibiliRegistrationRequestConnection } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestConnection.resolver.js"; import { mkBilibiliRegistrationRequestAcceptEventResolver, mkBilibiliRegistrationRequestEventResolver, mkBilibiliRegistrationRequestRejectEventResolver, mkBilibiliRegistrationRequestRequestEventResolver, -} from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestEvent.resolver.js"; -import { mkBilibiliRegistrationRequestEventConnectionResolver } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestEventConnection.resolver.js"; -import { mkBilibiliRegistrationRequestRejectingResolver } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestRejecting.resolver.js"; -import { resolverBilibiliRegistrationRequestRejectingNotification } from "../BilibiliRegistrationRequest/BilibiliRegistrationRequestRejectingNotification.resolver.js"; -import { mkBilibiliOriginalSourceResolver } from "../FetchExternal/BilibiliOriginalSource.resolver.js"; -import { resolverBilibiliOriginalSourceTag } from "../FetchExternal/BilibiliOriginalSourceTag.resolver.js"; -import { mkNicovideoOriginalSourceResolver } from "../FetchExternal/NicovideoOriginalSource.resolver.js"; -import { resolveNicovideoOriginalSourceTag } from "../FetchExternal/NicovideoOriginalSourceTag.resolver.js"; -import { mkSoundcloudOriginalSourceResolver } from "../FetchExternal/SoundcloudOriginalSource.resolver.js"; -import { resolverNicovideoRegistrationRequest } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequest.resolver.js"; -import { resolverNicovideoRegistrationRequestAccepting } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestAccepting.resolver.js"; -import { resolverNicovideoRegistrationRequestAcceptingNotification } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestAcceptingNotification.resolver.js"; -import { resolverNicovideoRegistrationRequestConnection } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestConnection.resolver.js"; +} from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestEvent.resolver.js"; +import { mkBilibiliRegistrationRequestEventConnectionResolver } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestEventConnection.resolver.js"; +import { mkBilibiliRegistrationRequestRejectingResolver } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestRejecting.resolver.js"; +import { resolverBilibiliRegistrationRequestRejectingNotification } from "./BilibiliRegistrationRequest/BilibiliRegistrationRequestRejectingNotification.resolver.js"; +import { mkBilibiliOriginalSourceResolver } from "./FetchExternal/BilibiliOriginalSource.resolver.js"; +import { resolverBilibiliOriginalSourceTag } from "./FetchExternal/BilibiliOriginalSourceTag.resolver.js"; +import { mkNicovideoOriginalSourceResolver } from "./FetchExternal/NicovideoOriginalSource.resolver.js"; +import { resolveNicovideoOriginalSourceTag } from "./FetchExternal/NicovideoOriginalSourceTag.resolver.js"; +import { mkSoundcloudOriginalSourceResolver } from "./FetchExternal/SoundcloudOriginalSource.resolver.js"; +import { resolveMutation } from "./mutation.js"; +import { resolverNicovideoRegistrationRequest } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequest.resolver.js"; +import { resolverNicovideoRegistrationRequestAccepting } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestAccepting.resolver.js"; +import { resolverNicovideoRegistrationRequestAcceptingNotification } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestAcceptingNotification.resolver.js"; +import { resolverNicovideoRegistrationRequestConnection } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestConnection.resolver.js"; import { mkNicovideoRegistrationRequestAcceptEventResolver, mkNicovideoRegistrationRequestEventResolver, mkNicovideoRegistrationRequestRejectEventResolver, mkNicovideoRegistrationRequestRequestEventResolver, -} from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestEvent.resolver.js"; -import { mkNicovideoRegistrationRequestEventConnectionResolver } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestEventConnection.resolver.js"; -import { resolverNicovideoRegistrationRequestRejecting } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestRejecting.resolver.js"; -import { resolverNicovideoRegistrationRequestRejectingNotification } from "../NicovideoRegistrationRequest/NicovideoRegistrationRequestRejectingNotification.resolver.js"; -import { resolverNicovideoVideoSource } from "../NicovideoVideoSource/NicovideoVideoSource.resolver.js"; +} from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestEvent.resolver.js"; +import { mkNicovideoRegistrationRequestEventConnectionResolver } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestEventConnection.resolver.js"; +import { resolverNicovideoRegistrationRequestRejecting } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestRejecting.resolver.js"; +import { resolverNicovideoRegistrationRequestRejectingNotification } from "./NicovideoRegistrationRequest/NicovideoRegistrationRequestRejectingNotification.resolver.js"; +import { resolverNicovideoVideoSource } from "./NicovideoVideoSource/NicovideoVideoSource.resolver.js"; import { resolveNicovideoVideoSourceCreateEvent, resolveNicovideoVideoSourceEvent, -} from "../NicovideoVideoSource/NicovideoVideoSourceEvent.resolver.js"; -import { mkSoundcloudMADSourceResolver } from "../SoundcloudMADSource/SoundcloudMADSource.resolver.js"; -import { resolveSoundcloudMADSourceCreateEvent } from "../SoundcloudMADSource/SoundcloudMADSourceEvent.resolver.js"; -import { resolverSoundcloudMADSourceEventConnection } from "../SoundcloudMADSource/SoundcloudMADSourceEventConnection.resolver.js"; -import { resolverSoundcloudRegistrationRequest } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequest.resolver.js"; -import { resolverSoundcloudRegistrationRequestAccepting } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestAccepting.resolver.js"; -import { resolverSoundcloudRegistrationRequestAcceptingNotification } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestAcceptingNotification.resolver.js"; -import { resolverSoundcloudRegistrationRequestConnection } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestConnection.resolver.js"; +} from "./NicovideoVideoSource/NicovideoVideoSourceEvent.resolver.js"; +import { resolveQuery } from "./query.js"; +import { type Resolvers } from "./resolvers/graphql.js"; +import { resolveMylist } from "./resolvers/Mylist/index.js"; +import { resolverMylistConnection } from "./resolvers/MylistConnection/resolver.js"; +import { resolveMylistGroup } from "./resolvers/MylistGroup/index.js"; +import { resolveMylistGroupMylistInclusion } from "./resolvers/MylistGroupMylistInclusion/index.js"; +import { resolveMylistGroupVideoAggregation } from "./resolvers/MylistGroupVideoAggregation/index.js"; +import { resolveMylistRegistration } from "./resolvers/MylistRegistration/index.js"; +import { resolverMylistRegistrationConnection } from "./resolvers/MylistRegistrationConnection/resolver.js"; +import { resolveMylistTagInclusion } from "./resolvers/MylistTagInclusion/index.js"; +import { resolveMylistVideoRecommendation } from "./resolvers/MylistVideoRecommendation/index.js"; +import { resolverNotification } from "./resolvers/Notification/resolver.js"; +import { resolverNotificationConnection } from "./resolvers/NotificationConnection/resolver.js"; +import { resolveSemitag } from "./resolvers/Semitag/index.js"; +import { resolverSemitagConnection } from "./resolvers/SemitagConnection/resolver.js"; +import { + resolveSemitagEvent, + resolveSemitagEventAttachEvent, + resolveSemitagEventRejectEvent, + resolveSemitagEventResolveEvent, +} from "./resolvers/SemitagEvent/index.js"; +import { resolverSemitagRejecting } from "./resolvers/SemitagRejecting/resolver.js"; +import { resolverSemitagResolving } from "./resolvers/SemitagResolving/resolver.js"; +import { resolverSemitagSuggestTagsItem } from "./resolvers/SemitagSuggestTagsItem/resolver.js"; +import { ResolverDeps } from "./resolvers/types.js"; +import { mkSoundcloudMADSourceResolver } from "./SoundcloudMADSource/SoundcloudMADSource.resolver.js"; +import { resolveSoundcloudMADSourceCreateEvent } from "./SoundcloudMADSource/SoundcloudMADSourceEvent.resolver.js"; +import { resolverSoundcloudMADSourceEventConnection } from "./SoundcloudMADSource/SoundcloudMADSourceEventConnection.resolver.js"; +import { resolverSoundcloudRegistrationRequest } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequest.resolver.js"; +import { resolverSoundcloudRegistrationRequestAccepting } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestAccepting.resolver.js"; +import { resolverSoundcloudRegistrationRequestAcceptingNotification } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestAcceptingNotification.resolver.js"; +import { resolverSoundcloudRegistrationRequestConnection } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestConnection.resolver.js"; import { mkSoundcloudRegistrationRequestAcceptEventResolver, mkSoundcloudRegistrationRequestEventResolver, mkSoundcloudRegistrationRequestRejectEventResolver, mkSoundcloudRegistrationRequestRequestEventResolver, -} from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestEvent.resolver.js"; -import { mkSoundcloudRegistrationRequestEventConnectionResolver } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestEventConnection.resolver.js"; -import { mkSoundcloudRegistrationRequestRejectingResolver } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestRejecting.resolver.js"; -import { resolverSoundcloudRegistrationRequestRejectingNotification } from "../SoundcloudRegistrationRequest/SoundcloudRegistrationRequestRejectingNotification.resolver.js"; -import { resolveTag } from "../Tag/Tag.resolver.js"; -import { resolveTagEvent, resolveTagRegisterEvent } from "../Tag/TagEvent.resolver.js"; -import { resolveTagName } from "../Tag/TagName.resolver.js"; +} from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestEvent.resolver.js"; +import { mkSoundcloudRegistrationRequestEventConnectionResolver } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestEventConnection.resolver.js"; +import { mkSoundcloudRegistrationRequestRejectingResolver } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestRejecting.resolver.js"; +import { resolverSoundcloudRegistrationRequestRejectingNotification } from "./SoundcloudRegistrationRequest/SoundcloudRegistrationRequestRejectingNotification.resolver.js"; +import { resolveTag } from "./Tag/Tag.resolver.js"; +import { resolveTagEvent, resolveTagRegisterEvent } from "./Tag/TagEvent.resolver.js"; +import { resolveTagName } from "./Tag/TagName.resolver.js"; import { resolveTagNameCreateEvent, resolveTagNameEvent, resolveTagNameSetPrimaryEvent, resolveTagNameUnsetPrimaryEvent, -} from "../Tag/TagNameEvent.resolver.js"; -import { resolveTagParent } from "../Tag/TagParent.resolver.js"; -import { resolverTagParentConnection } from "../Tag/TagParentConnection.resolver.js"; -import { resolverTagSearchItemByName } from "../Tag/TagSearchItemByName.resolver.js"; -import { resolverTypeCategoryTag } from "../Tag/TypeCategoryTag.resolver.js"; +} from "./Tag/TagNameEvent.resolver.js"; +import { resolveTagParent } from "./Tag/TagParent.resolver.js"; +import { resolverTagParentConnection } from "./Tag/TagParentConnection.resolver.js"; +import { resolverTagSearchItemByName } from "./Tag/TagSearchItemByName.resolver.js"; +import { resolverTypeCategoryTag } from "./Tag/TypeCategoryTag.resolver.js"; import { mkBilibiliMadRequestedTimelineEventResolver, mkMadRegisteredTimelineEventResolver, mkNicovideoMadRequestedTimelineEventResolver, mkSoundcloudMadRequestedTimelineEventResolver, mkYoutubeMadRequestedTimelineEventResolver, -} from "../Timeline/TimelineEvent.resolver.js"; -import { resolveUser } from "../User/User.resolver.js"; -import { resolveVideo } from "../Video/Video.resolver.js"; -import { resolverVideoConnection } from "../Video/VideoConnection.resolver.js"; -import { resolveVideoEvent, resolveVideoRegisterEvent } from "../Video/VideoEvent.resolver.js"; -import { resolverVideoSearchItemByTitle } from "../Video/VideoSearchItemByTitle.resolver.js"; -import { resolveVideoSimilarity } from "../Video/VideoSimilarity.resolver.js"; -import { resolveVideoTag } from "../Video/VideoTag.resolver.js"; +} from "./Timeline/TimelineEvent.resolver.js"; +import { resolveUser } from "./User/User.resolver.js"; +import { resolveVideo } from "./Video/Video.resolver.js"; +import { resolverVideoConnection } from "./Video/VideoConnection.resolver.js"; +import { resolveVideoEvent, resolveVideoRegisterEvent } from "./Video/VideoEvent.resolver.js"; +import { resolverVideoSearchItemByTitle } from "./Video/VideoSearchItemByTitle.resolver.js"; +import { resolveVideoSimilarity } from "./Video/VideoSimilarity.resolver.js"; +import { resolveVideoTag } from "./Video/VideoTag.resolver.js"; import { resolveVideoTagAttachEvent, resolveVideoTagDetachEvent, resolveVideoTagEvent, resolveVideoTagReattachEvent, -} from "../Video/VideoTagEvent.resolver.js"; -import { resolveVideoThumbnail } from "../Video/VideoThumbnail.resolver.js"; +} from "./Video/VideoTagEvent.resolver.js"; +import { resolveVideoThumbnail } from "./Video/VideoThumbnail.resolver.js"; import { resolveVideoThumbnailCreateEvent, resolveVideoThumbnailEvent, resolveVideoThumbnailSetPrimaryEvent, resolveVideoThumbnailUnsetPrimaryEvent, -} from "../Video/VideoThumbnailEvent.resolver.js"; -import { resolveVideoTitle } from "../Video/VideoTitle.resolver.js"; +} from "./Video/VideoThumbnailEvent.resolver.js"; +import { resolveVideoTitle } from "./Video/VideoTitle.resolver.js"; import { resolveVideoTitleCreateEvent, resolveVideoTitleEvent, resolveVideoTitleSetPrimaryEvent, resolveVideoTitleUnsetPrimaryEvent, -} from "../Video/VideoTitleEvent.resolver.js"; -import { resolverYoutubeRegistrationRequest } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequest.resolver.js"; -import { resolverYoutubeRegistrationRequestAccepting } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestAccepting.resolver.js"; -import { resolverYoutubeRegistrationRequestAcceptingNotification } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestAcceptingNotification.resolver.js"; -import { resolverYoutubeRegistrationRequestConnection } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestConnection.resolver.js"; +} from "./Video/VideoTitleEvent.resolver.js"; +import { resolverYoutubeRegistrationRequest } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequest.resolver.js"; +import { resolverYoutubeRegistrationRequestAccepting } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestAccepting.resolver.js"; +import { resolverYoutubeRegistrationRequestAcceptingNotification } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestAcceptingNotification.resolver.js"; +import { resolverYoutubeRegistrationRequestConnection } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestConnection.resolver.js"; import { mkYoutubeRegistrationRequestAcceptEventResolver, mkYoutubeRegistrationRequestEventResolver, mkYoutubeRegistrationRequestRejectEventResolver, mkYoutubeRegistrationRequestRequestEventResolver, -} from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestEvent.resolver.js"; -import { mkYoutubeRegistrationRequestEventConnectionResolver } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestEventConnection.resolver.js"; -import { resolverYoutubeRegistrationRequestRejecting } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestRejecting.resolver.js"; -import { resolverYoutubeRegistrationRequestRejectingNotification } from "../YoutubeRegistrationRequest/YoutubeRegistrationRequestRejectingNotification.resolver.js"; -import { resolveYoutubeVideoSource } from "../YoutubeVideoSource/YoutubeVideoSource.resolver.js"; +} from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestEvent.resolver.js"; +import { mkYoutubeRegistrationRequestEventConnectionResolver } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestEventConnection.resolver.js"; +import { resolverYoutubeRegistrationRequestRejecting } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestRejecting.resolver.js"; +import { resolverYoutubeRegistrationRequestRejectingNotification } from "./YoutubeRegistrationRequest/YoutubeRegistrationRequestRejectingNotification.resolver.js"; +import { resolveYoutubeVideoSource } from "./YoutubeVideoSource/YoutubeVideoSource.resolver.js"; import { resolveYoutubeVideoSourceCreateEvent, resolveYoutubeVideoSourceEvent, -} from "../YoutubeVideoSource/YoutubeVideoSourceEvent.resolver.js"; -import { resolverYoutubeVideoSourceEventConnection } from "../YoutubeVideoSource/YoutubeVideoSourceEventConnection.resolver.js"; -import { type Resolvers } from "./graphql.js"; -import { resolveMutation } from "./Mutation/index.js"; -import { resolveMylist } from "./Mylist/index.js"; -import { resolverMylistConnection } from "./MylistConnection/resolver.js"; -import { resolveMylistGroup } from "./MylistGroup/index.js"; -import { resolveMylistGroupMylistInclusion } from "./MylistGroupMylistInclusion/index.js"; -import { resolveMylistGroupVideoAggregation } from "./MylistGroupVideoAggregation/index.js"; -import { resolveMylistRegistration } from "./MylistRegistration/index.js"; -import { resolverMylistRegistrationConnection } from "./MylistRegistrationConnection/resolver.js"; -import { resolveMylistTagInclusion } from "./MylistTagInclusion/index.js"; -import { resolveMylistVideoRecommendation } from "./MylistVideoRecommendation/index.js"; -import { resolverNotification } from "./Notification/resolver.js"; -import { resolverNotificationConnection } from "./NotificationConnection/resolver.js"; -import { resolveQuery } from "./Query/index.js"; -import { resolveSemitag } from "./Semitag/index.js"; -import { resolverSemitagConnection } from "./SemitagConnection/resolver.js"; -import { - resolveSemitagEvent, - resolveSemitagEventAttachEvent, - resolveSemitagEventRejectEvent, - resolveSemitagEventResolveEvent, -} from "./SemitagEvent/index.js"; -import { resolverSemitagRejecting } from "./SemitagRejecting/resolver.js"; -import { resolverSemitagResolving } from "./SemitagResolving/resolver.js"; -import { resolverSemitagSuggestTagsItem } from "./SemitagSuggestTagsItem/resolver.js"; -import { ResolverDeps } from "./types.js"; +} from "./YoutubeVideoSource/YoutubeVideoSourceEvent.resolver.js"; +import { resolverYoutubeVideoSourceEventConnection } from "./YoutubeVideoSource/YoutubeVideoSourceEventConnection.resolver.js"; export const makeResolvers = (deps: ResolverDeps) => ({ diff --git a/src/resolvers/Mutation/index.ts b/src/resolvers/Mutation/index.ts deleted file mode 100644 index 1ee1643d..00000000 --- a/src/resolvers/Mutation/index.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint sort-keys: 2 */ - -import { mkRegisterBilibiliMADResolver } from "../../BilibiliMADSource/registerBilibiliMAD.resolver.js"; -import { mkRequestBilibiliRegistrationResolver } from "../../BilibiliRegistrationRequest/requestBilibiliRegistration.resolver.js"; -import { resolverRejectRequestNicovideoRegistration } from "../../NicovideoRegistrationRequest/rejectNicovideoRegistrationRequest.resolver.js"; -import { resolverRequestNicovideoRegistration } from "../../NicovideoRegistrationRequest/requestNicovideoRegistration.resolver.js"; -import { resolverRegisterVideoFromNicovideo } from "../../NicovideoVideoSource/registerVideoFromNicovideo.resolver.js"; -import { mkRegisterSoundcloudMADResolver } from "../../SoundcloudMADSource/registerSoundcloudMAD.resolver.js"; -import { mkRequestSoundcloudRegistrationResolver } from "../../SoundcloudRegistrationRequest/requestSoundcloudRegistration.resolver.js"; -import { resolverAddTagToVideo } from "../../Tag/addTagToVideo.resolver.js"; -import { resolverExplicitizeTagParent } from "../../Tag/explicitizeTagParent.resolver.js"; -import { resolverImplicitizeTagParent } from "../../Tag/implicitizeTagParent.resolver.js"; -import { registerCategoryTag } from "../../Tag/registerCategoryTag.resolver.js"; -import { resolverRegisterCategoryTagTyping } from "../../Tag/registerCategoryTagTyping.resolver.js"; -import { resolverRegisterTag } from "../../Tag/registerTag.resolver.js"; -import { resolverRegisterTagParentRelation } from "../../Tag/registerTagParentRelation.resolver.js"; -import { resolverRemoveTagFromVideo } from "../../Tag/removeTagFromVideo.resolver.js"; -import { mkRequestYoutubeRegistrationResolver } from "../../YoutubeRegistrationRequest/requestYoutubeRegistration.resolver.js"; -import { resolverRegisterVideoFromYoutube } from "../../YoutubeVideoSource/registerVideoFromYoutube.resolver.js"; -import { type Resolvers } from "../graphql.js"; -import { ResolverDeps } from "../types.js"; -import { addMylistToMylistGroup } from "./addMylistToMylistGroup/addMylistToMylistGroup.js"; -import { addSemitagToVideo } from "./addSemitagToVideo/addSemitagToVideo.js"; -import { addVideoToMylist } from "./addVideoToMylist/addVideoToMylist.js"; -import { resolverChangeMylistShareRange } from "./changeMylistShareRange/resolver.js"; -import { resolverChangeUserDisplayName } from "./changeUserDisplayName/resolver.js"; -import { createMylist } from "./createMylist/createMylist.js"; -import { createMylistGroup } from "./createMylistGroup/createMylistGroup.js"; -import { resolverLikeVideo } from "./likeVideo/resolver.js"; -import { resolverRejectSemitag } from "./rejectSemitag/resolver.js"; -import { removeVideoFromMylist } from "./removeVideoFromMylist/removeVideoFromMylist.js"; -import { resolverResolveSemitag } from "./resolveSemitag/resolver.js"; -import { resolverUndoLikeVideo } from "./undoLikeVideo/resolver.js"; -import { resolverWatchNotifications } from "./watchNotifications/resolver.js"; - -export const resolveMutation = (deps: ResolverDeps) => - ({ - addMylistToMylistGroup: addMylistToMylistGroup(deps), - addSemitagToVideo: addSemitagToVideo(deps), - addTagToVideo: resolverAddTagToVideo(deps), - addVideoToMylist: addVideoToMylist(deps), - changeMylistShareRange: resolverChangeMylistShareRange(deps), - changeUserDisplayName: resolverChangeUserDisplayName(deps), - createMylist: createMylist(deps), - createMylistGroup: createMylistGroup(deps), - explicitizeTagParent: resolverExplicitizeTagParent(deps), - implicitizeTagParent: resolverImplicitizeTagParent(deps), - likeVideo: resolverLikeVideo(deps), - registerBilibiliMAD: mkRegisterBilibiliMADResolver(deps), - registerCategoryTag: registerCategoryTag(deps), - registerCategoryTagTyping: resolverRegisterCategoryTagTyping(deps), - registerSoundcloudMAD: mkRegisterSoundcloudMADResolver(deps), - registerTag: resolverRegisterTag(deps), - registerTagParentRelation: resolverRegisterTagParentRelation(deps), - registerVideoFromNicovideo: resolverRegisterVideoFromNicovideo(deps), - registerVideoFromYoutube: resolverRegisterVideoFromYoutube(deps), - rejectNicovideoRegistrationRequest: resolverRejectRequestNicovideoRegistration(deps), - rejectSemitag: resolverRejectSemitag(deps), - removeTagFromVideo: resolverRemoveTagFromVideo(deps), - removeVideoFromMylist: removeVideoFromMylist(deps), - requestBilibiliRegistration: mkRequestBilibiliRegistrationResolver(deps), - requestNicovideoRegistration: resolverRequestNicovideoRegistration(deps), - requestSoundcloudRegistration: mkRequestSoundcloudRegistrationResolver(deps), - requestYoutubeRegistration: mkRequestYoutubeRegistrationResolver(deps), - resovleSemitag: resolverResolveSemitag(deps), - undoLikeVideo: resolverUndoLikeVideo(deps), - watchNotifications: resolverWatchNotifications(deps), - }) satisfies Resolvers["Mutation"]; diff --git a/src/resolvers/Query/index.ts b/src/resolvers/Query/index.ts deleted file mode 100644 index a100e1d6..00000000 --- a/src/resolvers/Query/index.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* eslint sort-keys: [2, "asc", {caseSensitive: false}] */ - -import { mkFindBilibiliMADSourceResolver } from "../../BilibiliMADSource/findBilibiliMADSource.resolver.js"; -import { resolverGetBilibiliMADSource } from "../../BilibiliMADSource/getBilibiliMADSource.resolver.js"; -import { mkFindBilibiliRegistrationRequestByUrlResolver } from "../../BilibiliRegistrationRequest/findBilibiliRegistrationRequestBySourceId.resolver.js"; -import { resolverFetchBilibili } from "../../FetchExternal/fetchBilibili.resolver.js"; -import { fetchNicovideo } from "../../FetchExternal/fetchNicovideo.js"; -import { mkFetchSoundcloudResolver } from "../../FetchExternal/fetchSoundcloud.resolver.js"; -import { resolverFetchYoutube } from "../../FetchExternal/fetchYoutube.js"; -import { mkListNicovideoBotRegistrationRequestsResolver } from "../../NicovideoBotRegistrationRequest/listNicovideoBotRegistrationRequests.resolver.js"; -import { resolverFindNicovideoRegistrationRequest } from "../../NicovideoRegistrationRequest/findNicovideoRegistrationRequest.resolver.js"; -import { findNicovideoRegistrationRequests } from "../../NicovideoRegistrationRequest/findNicovideoRegistrationRequests.resolver.js"; -import { resolverFindUncheckedNicovideoRegistrationRequests } from "../../NicovideoRegistrationRequest/findUncheckedNicovideoRegistrationRequests.resolver.js"; -import { resolverFindUncheckedNicovideoRegistrationRequestsByOffset } from "../../NicovideoRegistrationRequest/findUncheckedNicovideoRegistrationRequestsByOffset.resolver.js"; -import { resolverGetNicovideoRegistrationRequest } from "../../NicovideoRegistrationRequest/getNicovideoRegistrationRequest.js"; -import { resolverFindNicovideoVideoSource } from "../../NicovideoVideoSource/findNicovideoVideoSource.resolver.js"; -import { getNicovideoVideoSource } from "../../NicovideoVideoSource/getNicovideoVideoSource.resolver.js"; -import { mkFindSoundcloudMADSourceResolver } from "../../SoundcloudMADSource/findSoundcloudMADSource.resolver.js"; -import { getSoundcloudMADSource } from "../../SoundcloudMADSource/getSoundcloudMADSource.resolver.js"; -import { mkCountAllTagsResolver } from "../../Tag/countAllTags.resolver.js"; -import { resolverFindTag } from "../../Tag/findTag.resolver.js"; -import { resolverFindTagBySerial } from "../../Tag/findTagBySerial.resolver.js"; -import { resolverFindTags } from "../../Tag/findTags.resolver.js"; -import { resolverGetAllCategoryTag } from "../../Tag/getAllCategoryTag.resolver.js"; -import { resolverGetAllTypeCategoryTag } from "../../Tag/getAllTypeCategoryTag.resolver.js"; -import { resolverGetTag } from "../../Tag/getTag.resolver.js"; -import { resolverSearchTags } from "../../Tag/searchTags.resolver.js"; -import { mkShowTimelineResolver } from "../../Timeline/showTimeline.resolver.js"; -import { resolverFindUser } from "../../User/findUser.resolver.js"; -import { resolverGetUser } from "../../User/getUser.resolver.js"; -import { mkViewerResolver } from "../../User/viewer.resolver.js"; -import { mkCalcMadCountGrowthResolver } from "../../Video/calcMadCountGrowth.resolver.js"; -import { mkCountAllMadsResolver } from "../../Video/countAllMads.resolver.js"; -import { resolverFindMadBySerial } from "../../Video/findMadBySerial.resolver.js"; -import { mkFindMadsByOffsetResolver } from "../../Video/findMadsByOffset.resolver.js"; -import { resolverFindVideo } from "../../Video/findVideo.resolver.js"; -import { resolverFindVideos } from "../../Video/findVideos.resolver.js"; -import { resolverGetVideo } from "../../Video/getVideo.resolver.js"; -import { resolverSearchVideos } from "../../Video/searchVideos.resolver.js"; -import { resolverFindUncheckedYoutubeRegistrationRequests } from "../../YoutubeRegistrationRequest/findUncheckedYoutubeRegistrationRequests.resolver.js"; -import { resolverFindYoutubeRegistrationRequest } from "../../YoutubeRegistrationRequest/findYoutubeRegistrationRequest.resolver.js"; -import { resolverGetYoutubeRegistrationRequest } from "../../YoutubeRegistrationRequest/getYoutubeRegistrationRequest.resolver.js"; -import { resolverFindYoutubeVideoSource } from "../../YoutubeVideoSource/findYoutubeVideoSource.resolver.js"; -import { getYoutubeVideoSource } from "../../YoutubeVideoSource/getYoutubeVideoSource.resolver.js"; -import { type Resolvers } from "../graphql.js"; -import { ResolverDeps } from "../types.js"; -import { resolverFindMylist } from "./findMylist/findMylist.js"; -import { findSemitags } from "./findSemitags/findSemitags.js"; -import { getMylist } from "./getMylist/resolver.js"; -import { getMylistGroup } from "./getMylistGroup/resolver.js"; -import { getNotification } from "./getNotification/resolver.js"; -import { resolverGetSemitag } from "./getSemitag/resolver.js"; -import { resolverNotifications } from "./notifications/resolver.js"; -import { resolverWhoami } from "./whoami/resolver.js"; - -export const resolveQuery = (deps: ResolverDeps) => - ({ - calcMadCountGrowth: mkCalcMadCountGrowthResolver(deps), - countAllMads: mkCountAllMadsResolver(deps), - countAllTags: mkCountAllTagsResolver(deps), - fetchBilibili: resolverFetchBilibili(deps), - fetchNicovideo: fetchNicovideo(), - fetchSoundcloud: mkFetchSoundcloudResolver(deps), - fetchYoutube: resolverFetchYoutube(), - findBilibiliMADSource: mkFindBilibiliMADSourceResolver(deps), - findBilibiliRegistrationRequestBySourceId: mkFindBilibiliRegistrationRequestByUrlResolver(deps), - findMadBySerial: resolverFindMadBySerial(deps), - findMadsByOffset: mkFindMadsByOffsetResolver({ - ...deps, - logger: deps.logger.child({ resolver: "Query.findMadsByOffset" }), - }), - findMylist: resolverFindMylist(deps), - findNicovideoRegistrationRequest: resolverFindNicovideoRegistrationRequest(deps), - findNicovideoRegistrationRequests: findNicovideoRegistrationRequests(deps), - findNicovideoVideoSource: resolverFindNicovideoVideoSource(deps), - findSemitags: findSemitags(deps), - findSoundcloudMADSource: mkFindSoundcloudMADSourceResolver(deps), - findTag: resolverFindTag(deps), - findTagBySerial: resolverFindTagBySerial(deps), - findTags: resolverFindTags(deps), - findUncheckedNicovideoRegistrationRequests: resolverFindUncheckedNicovideoRegistrationRequests(deps), - findUncheckedNicovideoRegistrationRequestsByOffset: - resolverFindUncheckedNicovideoRegistrationRequestsByOffset(deps), - findUncheckedYoutubeRegistrationRequests: resolverFindUncheckedYoutubeRegistrationRequests(deps), - findUser: resolverFindUser(deps), - findVideo: resolverFindVideo(deps), - findVideos: resolverFindVideos(deps), - findYoutubeRegistrationRequest: resolverFindYoutubeRegistrationRequest(deps), - findYoutubeVideoSource: resolverFindYoutubeVideoSource(deps), - getAllCategoryTag: resolverGetAllCategoryTag(deps), - getAllTypeCategoryTag: resolverGetAllTypeCategoryTag(deps), - getBilibiliMADSource: resolverGetBilibiliMADSource(deps), - getMylist: getMylist(deps), - getMylistGroup: getMylistGroup(deps), - getNicovideoRegistrationRequest: resolverGetNicovideoRegistrationRequest(deps), - getNicovideoVideoSource: getNicovideoVideoSource(deps), - getNotification: getNotification(deps), - getSemitag: resolverGetSemitag(deps), - getSoundcloudMADSource: getSoundcloudMADSource(deps), - getTag: resolverGetTag(deps), - getUser: resolverGetUser(deps), - getVideo: resolverGetVideo(deps), - getYoutubeRegistrationRequest: resolverGetYoutubeRegistrationRequest(deps), - getYoutubeVideoSource: getYoutubeVideoSource(deps), - listNicovideoBotRegistrationRequests: mkListNicovideoBotRegistrationRequestsResolver(deps), - notifications: resolverNotifications(deps), - searchTags: resolverSearchTags(deps), - searchVideos: resolverSearchVideos(deps), - showTimeline: mkShowTimelineResolver(deps), - viewer: mkViewerResolver({ ...deps }), - whoami: resolverWhoami(deps), - }) satisfies Resolvers["Query"];