aboutsummaryrefslogtreecommitdiff
path: root/src/graphql/anime
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphql/anime')
-rw-r--r--src/graphql/anime/resolvers.ts32
-rw-r--r--src/graphql/anime/schema.graphql30
2 files changed, 31 insertions, 31 deletions
diff --git a/src/graphql/anime/resolvers.ts b/src/graphql/anime/resolvers.ts
index 7d04082d..5f49b364 100644
--- a/src/graphql/anime/resolvers.ts
+++ b/src/graphql/anime/resolvers.ts
@@ -2,21 +2,21 @@ import type { WithIndex } from '../$types';
import type { Resolvers } from './$types';
export const resolvers: WithIndex<Resolvers> = {
- Query: {
- Anime: async (_, args) => {
- const timezone = args.timezone || 'Asia/Tokyo';
+ Query: {
+ Anime: async (_, args) => {
+ const timezone = args.timezone || 'Asia/Tokyo';
- return {
- subtitles: {
- timezone,
- schedule: Object.fromEntries(
- Object.entries(
- (await (await fetch(`https://subsplease.org/api/?f=schedule&tz=${timezone}`)).json())
- .schedule
- ).map(([key, value]) => [key.toLowerCase(), value])
- )
- }
- };
- }
- }
+ return {
+ subtitles: {
+ timezone,
+ schedule: Object.fromEntries(
+ Object.entries(
+ (await (await fetch(`https://subsplease.org/api/?f=schedule&tz=${timezone}`)).json())
+ .schedule
+ ).map(([key, value]) => [key.toLowerCase(), value])
+ )
+ }
+ };
+ }
+ }
};
diff --git a/src/graphql/anime/schema.graphql b/src/graphql/anime/schema.graphql
index d5774966..a0415944 100644
--- a/src/graphql/anime/schema.graphql
+++ b/src/graphql/anime/schema.graphql
@@ -1,29 +1,29 @@
type Query {
- Anime(timezone: String): Anime!
+ Anime(timezone: String): Anime!
}
type Anime {
- subtitles: Subtitles
+ subtitles: Subtitles
}
type Subtitles {
- timezone: String
- schedule: SubtitleSchedule
+ timezone: String
+ schedule: SubtitleSchedule
}
type SubtitleSchedule {
- monday: [Subtitle]
- tuesday: [Subtitle]
- wednesday: [Subtitle]
- thursday: [Subtitle]
- friday: [Subtitle]
- saturday: [Subtitle]
- sunday: [Subtitle]
+ monday: [Subtitle]
+ tuesday: [Subtitle]
+ wednesday: [Subtitle]
+ thursday: [Subtitle]
+ friday: [Subtitle]
+ saturday: [Subtitle]
+ sunday: [Subtitle]
}
type Subtitle {
- title: String
- page: String
- image_url: String
- time: String
+ title: String
+ page: String
+ image_url: String
+ time: String
}