All in GraphQL #34

Merged
timw4mail merged 87 commits from develop into master 2020-12-01 10:07:49 -05:00
10 changed files with 320 additions and 101 deletions
Showing only changes of commit 40a340c67c - Show all commits

View File

@ -77,7 +77,7 @@ final class Model
]) ])
->getFullRequest(); ->getFullRequest();
$response = $this->getResponseFromRequest($request); $response = $this->requestBuilder->getResponseFromRequest($request);
return Json::decode(wait($response->getBody()->buffer())); return Json::decode(wait($response->getBody()->buffer()));
} }

View File

@ -218,7 +218,7 @@ final class RequestBuilder extends APIRequestBuilder {
* @return Response * @return Response
* @throws Throwable * @throws Throwable
*/ */
private function getResponseFromRequest(Request $request): Response public function getResponseFromRequest(Request $request): Response
{ {
$logger = $this->container->getLogger('anilist-request'); $logger = $this->container->getLogger('anilist-request');

View File

@ -138,7 +138,7 @@ final class Kitsu {
/** /**
* Reorganize streaming links * Reorganize streaming links
* *
* @param array $included * @param array $nodes
* @return array * @return array
*/ */
public static function parseStreamingLinks(array $nodes): array public static function parseStreamingLinks(array $nodes): array

View File

@ -72,6 +72,20 @@ trait AnimeTrait {
return $this->animeTransformer->transform($baseData); return $this->animeTransformer->transform($baseData);
} }
/**
* Get information about a particular anime
*
* @param string $animeId
* @return Anime
*/
public function getAnimeById(string $animeId): Anime
{
$baseData = $this->requestBuilder->runQuery('AnimeDetailsById', [
'id' => $animeId,
]);
return $this->animeTransformer->transform($baseData);
}
/** /**
* Retrieve the data for the anime watch history page * Retrieve the data for the anime watch history page
* *
@ -100,21 +114,6 @@ trait AnimeTrait {
return $list; return $list;
} }
/**
* Get information about a particular anime
*
* @param string $animeId
* @return Anime
*/
public function getAnimeById(string $animeId): Anime
{
$baseData = $this->requestBuilder->runQuery('AnimeDetailsById', [
'id' => $animeId,
]);
// $baseData = $this->getRawMediaDataById('anime', $animeId);
return $this->animeTransformer->transform($baseData);
}
/** /**
* Get the anime list for the configured user * Get the anime list for the configured user
* *

View File

@ -59,6 +59,12 @@ query ($slug: String!) {
season season
sfw sfw
slug slug
mappings {
nodes {
externalId
externalSite
}
}
staff { staff {
nodes { nodes {
person { person {

View File

@ -59,6 +59,12 @@ query ($id: ID!) {
season season
sfw sfw
slug slug
mappings {
nodes {
externalId
externalSite
}
}
staff { staff {
nodes { nodes {
person { person {

View File

@ -54,6 +54,12 @@ query ($slug: String!) {
description description
startDate startDate
endDate endDate
mappings {
nodes {
externalId
externalSite
}
}
posterImage { posterImage {
original { original {
height height

View File

@ -54,6 +54,12 @@ query ($id: ID!) {
description description
startDate startDate
endDate endDate
mappings {
nodes {
externalId
externalSite
}
}
posterImage { posterImage {
original { original {
height height

View File

@ -17,11 +17,18 @@ query ($slug: String!) {
height height
} }
} }
birthday
id id
name name
proMessage proMessage
proTier proTier
slug slug
siteLinks {
nodes {
id
url
}
}
stats { stats {
animeAmountConsumed { animeAmountConsumed {
completed completed
@ -31,11 +38,6 @@ query ($slug: String!) {
time time
units units
} }
animeCategoryBreakdown {
categories
recalculatedAt
total
}
mangaAmountConsumed { mangaAmountConsumed {
completed completed
id id
@ -43,15 +45,11 @@ query ($slug: String!) {
recalculatedAt recalculatedAt
units units
} }
mangaCategoryBreakdown {
categories
recalculatedAt
total
}
} }
url url
waifu { waifu {
id id
slug
image { image {
original { original {
name name
@ -65,16 +63,7 @@ query ($slug: String!) {
alternatives alternatives
localized localized
} }
primaryMedia {
slug
titles {
canonical
alternatives
localized
}
}
slug
} }
# waifuOrHusbando waifuOrHusbando
} }
} }

View File

@ -195,13 +195,35 @@ interface Streamable {
subs: [String!]! subs: [String!]!
} }
"Media units such as episodes or chapters"
interface Unit {
"A brief summary or description of the unit"
description(locales: [String!]): Map!
id: ID!
"The sequence number of this unit"
number: Int!
"A thumbnail image for the unit"
thumbnail: Image
"The titles for this unit in various locales"
titles: TitlesList!
}
interface WithTimestamps {
createdAt: ISO8601DateTime!
updatedAt: ISO8601DateTime!
}
"Objects which are Favoritable"
union FavoriteItem = Anime | Character | Manga | Person
"Objects which are Mappable" "Objects which are Mappable"
union MappingItem = Anime | Category | Character | Episode | Manga | Person | Producer union MappingItem = Anime | Category | Character | Episode | Manga | Person | Producer
"A user account on Kitsu" "A user account on Kitsu"
type Account { type Account implements WithTimestamps {
"The country this user resides in" "The country this user resides in"
country: String country: String
createdAt: ISO8601DateTime!
"The email addresses associated with this account" "The email addresses associated with this account"
email: [String!]! email: [String!]!
"Facebook account linked to the account" "Facebook account linked to the account"
@ -225,9 +247,10 @@ type Account {
titleLanguagePreference: TitleLanguagePreference titleLanguagePreference: TitleLanguagePreference
"Twitter account linked to the account" "Twitter account linked to the account"
twitterId: String twitterId: String
updatedAt: ISO8601DateTime!
} }
type Anime implements Episodic & Media { type Anime implements Episodic & Media & WithTimestamps {
"The recommended minimum age group for this media" "The recommended minimum age group for this media"
ageRating: AgeRating ageRating: AgeRating
"An explanation of why this received the age rating it did" "An explanation of why this received the age rating it did"
@ -258,6 +281,7 @@ type Anime implements Episodic & Media {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): MediaCharacterConnection! ): MediaCharacterConnection!
createdAt: ISO8601DateTime!
"A brief (mostly spoiler free) summary or description of the media." "A brief (mostly spoiler free) summary or description of the media."
description(locales: [String!]): Map! description(locales: [String!]): Map!
"the day that this media made its final release" "the day that this media made its final release"
@ -371,15 +395,17 @@ type Anime implements Episodic & Media {
totalLength: Int totalLength: Int
"Anime or Manga." "Anime or Manga."
type: String! type: String!
updatedAt: ISO8601DateTime!
"The number of users with this in their library" "The number of users with this in their library"
userCount: Int userCount: Int
"Video id for a trailer on YouTube" "Video id for a trailer on YouTube"
youtubeTrailerVideoId: String youtubeTrailerVideoId: String
} }
type AnimeAmountConsumed implements AmountConsumed { type AnimeAmountConsumed implements AmountConsumed & WithTimestamps {
"Total media completed atleast once." "Total media completed atleast once."
completed: Int! completed: Int!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"Total amount of media." "Total amount of media."
media: Int! media: Int!
@ -391,11 +417,13 @@ type AnimeAmountConsumed implements AmountConsumed {
time: Int! time: Int!
"Total progress of library including reconsuming." "Total progress of library including reconsuming."
units: Int! units: Int!
updatedAt: ISO8601DateTime!
} }
type AnimeCategoryBreakdown implements CategoryBreakdown { type AnimeCategoryBreakdown implements CategoryBreakdown & WithTimestamps {
"A Map of category_id -> count for all categories present on the library entries" "A Map of category_id -> count for all categories present on the library entries"
categories: Map! categories: Map!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The profile related to the user for this stat." "The profile related to the user for this stat."
profile: Profile! profile: Profile!
@ -403,6 +431,7 @@ type AnimeCategoryBreakdown implements CategoryBreakdown {
recalculatedAt: ISO8601Date! recalculatedAt: ISO8601Date!
"The total amount of library entries." "The total amount of library entries."
total: Int! total: Int!
updatedAt: ISO8601DateTime!
} }
"The connection type for Anime." "The connection type for Anime."
@ -439,12 +468,13 @@ type AnimeEdge {
node: Anime node: Anime
} }
type AnimeMutation { type AnimeMutation implements WithTimestamps {
"Create an Anime." "Create an Anime."
create( create(
"Create an Anime." "Create an Anime."
input: AnimeCreateInput! input: AnimeCreateInput!
): AnimeCreatePayload ): AnimeCreatePayload
createdAt: ISO8601DateTime!
"Delete an Anime." "Delete an Anime."
delete( delete(
"Delete an Anime." "Delete an Anime."
@ -455,6 +485,7 @@ type AnimeMutation {
"Update an Anime." "Update an Anime."
input: AnimeUpdateInput! input: AnimeUpdateInput!
): AnimeUpdatePayload ): AnimeUpdatePayload
updatedAt: ISO8601DateTime!
} }
"Autogenerated return type of AnimeUpdate" "Autogenerated return type of AnimeUpdate"
@ -465,7 +496,7 @@ type AnimeUpdatePayload {
} }
"Information about a specific Category" "Information about a specific Category"
type Category { type Category implements WithTimestamps {
"The child categories." "The child categories."
children( children(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -477,6 +508,7 @@ type Category {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): CategoryConnection ): CategoryConnection
createdAt: ISO8601DateTime!
"A brief summary or description of the catgory." "A brief summary or description of the catgory."
description(locales: [String!]): Map! description(locales: [String!]): Map!
id: ID! id: ID!
@ -488,6 +520,7 @@ type Category {
slug: String! slug: String!
"The name of the category." "The name of the category."
title(locales: [String!]): Map! title(locales: [String!]): Map!
updatedAt: ISO8601DateTime!
} }
"The connection type for Category." "The connection type for Category."
@ -510,23 +543,25 @@ type CategoryEdge {
node: Category node: Category
} }
"A single chapter part of a volume." "A single chapter of a manga"
type Chapter { type Chapter implements Unit & WithTimestamps {
createdAt: ISO8601DateTime!
"A brief summary or description of the unit"
description(locales: [String!]): Map!
id: ID! id: ID!
"The manga this chapter is in." "The manga this chapter is in."
manga: Manga! manga: Manga!
"The number of pages in this chapter." "The sequence number of this unit"
number: Int! number: Int!
"The date when this chapter was released." "When this chapter was released"
published: ISO8601Date releasedAt: ISO8601Date
"A thumbnail image for the chapter." "A thumbnail image for the unit"
thumbnail: Image thumbnail: Image
"The titles for this chapter in various locales" "The titles for this unit in various locales"
titles: TitlesList! titles: TitlesList!
updatedAt: ISO8601DateTime!
"The volume this chapter is in." "The volume this chapter is in."
volume: Volume volume: Volume
"The volume number this chapter is in."
volumeNumber: Int
} }
"The connection type for Chapter." "The connection type for Chapter."
@ -550,7 +585,8 @@ type ChapterEdge {
} }
"Information about a Character in the Kitsu database" "Information about a Character in the Kitsu database"
type Character { type Character implements WithTimestamps {
createdAt: ISO8601DateTime!
"A brief summary or description of the character." "A brief summary or description of the character."
description(locales: [String!]): Map! description(locales: [String!]): Map!
id: ID! id: ID!
@ -573,10 +609,12 @@ type Character {
primaryMedia: Media primaryMedia: Media
"The URL-friendly identifier of this character" "The URL-friendly identifier of this character"
slug: String! slug: String!
updatedAt: ISO8601DateTime!
} }
"Information about a VA (Person) voicing a Character in a Media" "Information about a VA (Person) voicing a Character in a Media"
type CharacterVoice { type CharacterVoice implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The company who hired this voice actor to play this role" "The company who hired this voice actor to play this role"
licensor: Producer licensor: Producer
@ -586,6 +624,7 @@ type CharacterVoice {
mediaCharacter: MediaCharacter! mediaCharacter: MediaCharacter!
"The person who voice acted this role" "The person who voice acted this role"
person: Person! person: Person!
updatedAt: ISO8601DateTime!
} }
"The connection type for CharacterVoice." "The connection type for CharacterVoice."
@ -609,13 +648,14 @@ type CharacterVoiceEdge {
} }
"A comment on a post" "A comment on a post"
type Comment { type Comment implements WithTimestamps {
"The user who created this comment for the parent post." "The user who created this comment for the parent post."
author: Profile! author: Profile!
"Unmodified content." "Unmodified content."
content: String! content: String!
"Html formatted content." "Html formatted content."
contentFormatted: String! contentFormatted: String!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"Users who liked this comment." "Users who liked this comment."
likes( likes(
@ -643,6 +683,7 @@ type Comment {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): CommentConnection! ): CommentConnection!
updatedAt: ISO8601DateTime!
} }
"The connection type for Comment." "The connection type for Comment."
@ -666,20 +707,24 @@ type CommentEdge {
} }
"An Episode of a Media" "An Episode of a Media"
type Episode { type Episode implements Unit & WithTimestamps {
"The time when the episode aired" "The anime this episode is in"
airedAt: ISO8601DateTime anime: Anime!
"A brief summary or description of the episode." createdAt: ISO8601DateTime!
"A brief summary or description of the unit"
description(locales: [String!]): Map! description(locales: [String!]): Map!
id: ID! id: ID!
"The length of the Episode in seconds" "The length of the episode in seconds"
length: Int length: Int
"The sequence number of this episode in the season" "The sequence number of this unit"
number: Int! number: Int!
"A thumbnail image for the episode" "When this episode aired"
releasedAt: ISO8601DateTime
"A thumbnail image for the unit"
thumbnail: Image thumbnail: Image
"The titles for this episode in various locales" "The titles for this unit in various locales"
titles: TitlesList! titles: TitlesList!
updatedAt: ISO8601DateTime!
} }
"The connection type for Episode." "The connection type for Episode."
@ -702,33 +747,72 @@ type EpisodeEdge {
node: Episode node: Episode
} }
type Generic implements Base { "Favorite media, characters, and people for a user"
type Favorite implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID!
"The kitsu object that is mapped"
item: FavoriteItem!
updatedAt: ISO8601DateTime!
"The user who favorited this item"
user: Profile!
}
"The connection type for Favorite."
type FavoriteConnection {
"A list of edges."
edges: [FavoriteEdge]
"A list of nodes."
nodes: [Favorite]
"Information to aid in pagination."
pageInfo: PageInfo!
"The total amount of nodes."
totalCount: Int!
}
"An edge in a connection."
type FavoriteEdge {
"A cursor for use in pagination."
cursor: String!
"The item at the end of the edge."
node: Favorite
}
type Generic implements Base & WithTimestamps {
"The error code." "The error code."
code: String code: String
createdAt: ISO8601DateTime!
"A description of the error" "A description of the error"
message: String! message: String!
"Which input value this error came from" "Which input value this error came from"
path: [String!] path: [String!]
updatedAt: ISO8601DateTime!
} }
type GenericDelete { type GenericDelete implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
updatedAt: ISO8601DateTime!
} }
type Image { type Image implements WithTimestamps {
"A blurhash-encoded version of this image" "A blurhash-encoded version of this image"
blurhash: String blurhash: String
createdAt: ISO8601DateTime!
"The original image" "The original image"
original: ImageView! original: ImageView!
updatedAt: ISO8601DateTime!
"The various generated views of this image" "The various generated views of this image"
views(names: [String!]): [ImageView!]! views(names: [String!]): [ImageView!]!
} }
type ImageView { type ImageView implements WithTimestamps {
createdAt: ISO8601DateTime!
"The height of the image" "The height of the image"
height: Int height: Int
"The name of this view of the image" "The name of this view of the image"
name: String! name: String!
updatedAt: ISO8601DateTime!
"The URL of this view of the image" "The URL of this view of the image"
url: String! url: String!
"The width of the image" "The width of the image"
@ -736,7 +820,7 @@ type ImageView {
} }
"The user library filterable by media_type and status" "The user library filterable by media_type and status"
type Library { type Library implements WithTimestamps {
"All Library Entries for a specific Media" "All Library Entries for a specific Media"
all( all(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -747,7 +831,8 @@ type Library {
first: Int, first: Int,
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int, last: Int,
mediaType: media_type! mediaType: media_type!,
status: [LibraryEntryStatus!]
): LibraryEntryConnection! ): LibraryEntryConnection!
"Library Entries for a specific Media filtered by the completed status" "Library Entries for a specific Media filtered by the completed status"
completed( completed(
@ -761,6 +846,7 @@ type Library {
last: Int, last: Int,
mediaType: media_type! mediaType: media_type!
): LibraryEntryConnection! ): LibraryEntryConnection!
createdAt: ISO8601DateTime!
"Library Entries for a specific Media filtered by the current status" "Library Entries for a specific Media filtered by the current status"
current( current(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -809,10 +895,12 @@ type Library {
last: Int, last: Int,
mediaType: media_type! mediaType: media_type!
): LibraryEntryConnection! ): LibraryEntryConnection!
updatedAt: ISO8601DateTime!
} }
"Information about a specific media entry for a user" "Information about a specific media entry for a user"
type LibraryEntry { type LibraryEntry implements WithTimestamps {
createdAt: ISO8601DateTime!
"History of user actions for this library entry." "History of user actions for this library entry."
events( events(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -828,8 +916,12 @@ type LibraryEntry {
"When the user finished this media." "When the user finished this media."
finishedAt: ISO8601DateTime finishedAt: ISO8601DateTime
id: ID! id: ID!
"The last unit consumed"
lastUnit: Unit
"The media related to this library entry." "The media related to this library entry."
media: Media! media: Media!
"The next unit to be consumed"
nextUnit: Unit
"Notes left by the profile related to this library entry." "Notes left by the profile related to this library entry."
notes: String notes: String
"If the media related to the library entry is Not-Safe-for-Work." "If the media related to the library entry is Not-Safe-for-Work."
@ -851,6 +943,7 @@ type LibraryEntry {
"When the user started this media." "When the user started this media."
startedAt: ISO8601DateTime startedAt: ISO8601DateTime
status: LibraryEntryStatus! status: LibraryEntryStatus!
updatedAt: ISO8601DateTime!
"The user who created this library entry." "The user who created this library entry."
user: Profile! user: Profile!
"Volumes that the profile owns (physically or digital)." "Volumes that the profile owns (physically or digital)."
@ -891,22 +984,34 @@ type LibraryEntryEdge {
node: LibraryEntry node: LibraryEntry
} }
type LibraryEntryMutation { type LibraryEntryMutation implements WithTimestamps {
"Create a Library Entry." "Create a library entry"
create( create(
"Create a Library Entry" "Create a Library Entry"
input: LibraryEntryCreateInput! input: LibraryEntryCreateInput!
): LibraryEntryCreatePayload ): LibraryEntryCreatePayload
"Delete a Library Entry." createdAt: ISO8601DateTime!
"Delete a library entry"
delete( delete(
"Delete Library Entry" "Delete Library Entry"
input: GenericDeleteInput! input: GenericDeleteInput!
): LibraryEntryDeletePayload ): LibraryEntryDeletePayload
"Update a Library Entry." "Update a library entry"
update( update(
"Update Library Entry" "Update Library Entry"
input: LibraryEntryUpdateInput! input: LibraryEntryUpdateInput!
): LibraryEntryUpdatePayload ): LibraryEntryUpdatePayload
"Update a library entry status by id"
updateStatusById(
"Update a library entry status by id"
input: UpdateStatusByIdInput!
): LibraryEntryUpdateStatusByIdPayload
"Update a library entry status by media"
updateStatusByMedia(
"Update a library entry status by media"
input: UpdateStatusByMediaInput!
): LibraryEntryUpdateStatusByMediaPayload
updatedAt: ISO8601DateTime!
} }
"Autogenerated return type of LibraryEntryUpdate" "Autogenerated return type of LibraryEntryUpdate"
@ -916,10 +1021,25 @@ type LibraryEntryUpdatePayload {
libraryEntry: LibraryEntry libraryEntry: LibraryEntry
} }
"Autogenerated return type of LibraryEntryUpdateStatusById"
type LibraryEntryUpdateStatusByIdPayload {
"Graphql Errors"
errors: [Generic!]
libraryEntry: LibraryEntry
}
"Autogenerated return type of LibraryEntryUpdateStatusByMedia"
type LibraryEntryUpdateStatusByMediaPayload {
"Graphql Errors"
errors: [Generic!]
libraryEntry: LibraryEntry
}
"History of user actions for a library entry." "History of user actions for a library entry."
type LibraryEvent { type LibraryEvent implements WithTimestamps {
"The data that was changed for this library event." "The data that was changed for this library event."
changedData: Map! changedData: Map!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The type of library event." "The type of library event."
kind: LibraryEventKind! kind: LibraryEventKind!
@ -927,6 +1047,7 @@ type LibraryEvent {
libraryEntry: LibraryEntry! libraryEntry: LibraryEntry!
"The media related to this library event." "The media related to this library event."
media: Media! media: Media!
updatedAt: ISO8601DateTime!
"The user who created this library event" "The user who created this library event"
user: Profile! user: Profile!
} }
@ -951,7 +1072,7 @@ type LibraryEventEdge {
node: LibraryEvent node: LibraryEvent
} }
type Manga implements Media { type Manga implements Media & WithTimestamps {
"The recommended minimum age group for this media" "The recommended minimum age group for this media"
ageRating: AgeRating ageRating: AgeRating
"An explanation of why this received the age rating it did" "An explanation of why this received the age rating it did"
@ -997,6 +1118,7 @@ type Manga implements Media {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): MediaCharacterConnection! ): MediaCharacterConnection!
createdAt: ISO8601DateTime!
"A brief (mostly spoiler free) summary or description of the media." "A brief (mostly spoiler free) summary or description of the media."
description(locales: [String!]): Map! description(locales: [String!]): Map!
"the day that this media made its final release" "the day that this media made its final release"
@ -1081,15 +1203,17 @@ type Manga implements Media {
titles: TitlesList! titles: TitlesList!
"Anime or Manga." "Anime or Manga."
type: String! type: String!
updatedAt: ISO8601DateTime!
"The number of users with this in their library" "The number of users with this in their library"
userCount: Int userCount: Int
"The number of volumes in this manga." "The number of volumes in this manga."
volumeCount: Int volumeCount: Int
} }
type MangaAmountConsumed implements AmountConsumed { type MangaAmountConsumed implements AmountConsumed & WithTimestamps {
"Total media completed atleast once." "Total media completed atleast once."
completed: Int! completed: Int!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"Total amount of media." "Total amount of media."
media: Int! media: Int!
@ -1099,11 +1223,13 @@ type MangaAmountConsumed implements AmountConsumed {
recalculatedAt: ISO8601Date! recalculatedAt: ISO8601Date!
"Total progress of library including reconsuming." "Total progress of library including reconsuming."
units: Int! units: Int!
updatedAt: ISO8601DateTime!
} }
type MangaCategoryBreakdown implements CategoryBreakdown { type MangaCategoryBreakdown implements CategoryBreakdown & WithTimestamps {
"A Map of category_id -> count for all categories present on the library entries" "A Map of category_id -> count for all categories present on the library entries"
categories: Map! categories: Map!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The profile related to the user for this stat." "The profile related to the user for this stat."
profile: Profile! profile: Profile!
@ -1111,6 +1237,7 @@ type MangaCategoryBreakdown implements CategoryBreakdown {
recalculatedAt: ISO8601Date! recalculatedAt: ISO8601Date!
"The total amount of library entries." "The total amount of library entries."
total: Int! total: Int!
updatedAt: ISO8601DateTime!
} }
"The connection type for Manga." "The connection type for Manga."
@ -1134,7 +1261,8 @@ type MangaEdge {
} }
"Media Mappings from External Sites (MAL, Anilist, etc..) to Kitsu." "Media Mappings from External Sites (MAL, Anilist, etc..) to Kitsu."
type Mapping { type Mapping implements WithTimestamps {
createdAt: ISO8601DateTime!
"The ID of the media from the external site." "The ID of the media from the external site."
externalId: ID! externalId: ID!
"The name of the site which kitsu media is being linked from." "The name of the site which kitsu media is being linked from."
@ -1142,6 +1270,7 @@ type Mapping {
id: ID! id: ID!
"The kitsu object that is mapped." "The kitsu object that is mapped."
item: MappingItem! item: MappingItem!
updatedAt: ISO8601DateTime!
} }
"The connection type for Mapping." "The connection type for Mapping."
@ -1165,14 +1294,16 @@ type MappingEdge {
} }
"Information about a Character starring in a Media" "Information about a Character starring in a Media"
type MediaCharacter { type MediaCharacter implements WithTimestamps {
"The character" "The character"
character: Character! character: Character!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The media" "The media"
media: Media! media: Media!
"The role this character had in the media" "The role this character had in the media"
role: CharacterRole! role: CharacterRole!
updatedAt: ISO8601DateTime!
"The voices of this character" "The voices of this character"
voices( voices(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -1226,7 +1357,8 @@ type MediaEdge {
} }
"The role a company played in the creation or localization of a media" "The role a company played in the creation or localization of a media"
type MediaProduction { type MediaProduction implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The media" "The media"
media: Media! media: Media!
@ -1234,6 +1366,7 @@ type MediaProduction {
person: Producer! person: Producer!
"The role this company played" "The role this company played"
role: String! role: String!
updatedAt: ISO8601DateTime!
} }
"The connection type for MediaProduction." "The connection type for MediaProduction."
@ -1257,9 +1390,10 @@ type MediaProductionEdge {
} }
"A simple review that is 140 characters long expressing how you felt about a media" "A simple review that is 140 characters long expressing how you felt about a media"
type MediaReaction { type MediaReaction implements WithTimestamps {
"The author who wrote this reaction." "The author who wrote this reaction."
author: Profile! author: Profile!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The library entry related to this reaction." "The library entry related to this reaction."
libraryEntry: LibraryEntry! libraryEntry: LibraryEntry!
@ -1280,6 +1414,7 @@ type MediaReaction {
progress: Int! progress: Int!
"The reaction text related to a media." "The reaction text related to a media."
reaction: String! reaction: String!
updatedAt: ISO8601DateTime!
} }
"The connection type for MediaReaction." "The connection type for MediaReaction."
@ -1303,7 +1438,8 @@ type MediaReactionEdge {
} }
"Information about a person working on an anime" "Information about a person working on an anime"
type MediaStaff { type MediaStaff implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The media" "The media"
media: Media! media: Media!
@ -1311,6 +1447,7 @@ type MediaStaff {
person: Person! person: Person!
"The role this person had in the creation of this media" "The role this person had in the creation of this media"
role: String! role: String!
updatedAt: ISO8601DateTime!
} }
"The connection type for MediaStaff." "The connection type for MediaStaff."
@ -1333,10 +1470,12 @@ type MediaStaffEdge {
node: MediaStaff node: MediaStaff
} }
type Mutation { type Mutation implements WithTimestamps {
anime: AnimeMutation anime: AnimeMutation
createdAt: ISO8601DateTime!
libraryEntry: LibraryEntryMutation libraryEntry: LibraryEntryMutation
pro: ProMutation! pro: ProMutation!
updatedAt: ISO8601DateTime!
} }
"Information about pagination in a connection." "Information about pagination in a connection."
@ -1356,9 +1495,10 @@ type PageInfo {
A Voice Actor, Director, Animator, or other person who works in the creation and\ A Voice Actor, Director, Animator, or other person who works in the creation and\
localization of media localization of media
""" """
type Person { type Person implements WithTimestamps {
"The day when this person was born" "The day when this person was born"
birthday: Date birthday: Date
createdAt: ISO8601DateTime!
"A brief biography or description of the person." "A brief biography or description of the person."
description(locales: [String!]): Map! description(locales: [String!]): Map!
id: ID! id: ID!
@ -1370,6 +1510,7 @@ type Person {
names: TitlesList! names: TitlesList!
"The URL-friendly identifier of this person." "The URL-friendly identifier of this person."
slug: String! slug: String!
updatedAt: ISO8601DateTime!
"The voice-acting roles this person has had." "The voice-acting roles this person has had."
voices( voices(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -1384,7 +1525,7 @@ type Person {
} }
"A post that is visible to your followers and globally in the news-feed." "A post that is visible to your followers and globally in the news-feed."
type Post { type Post implements WithTimestamps {
"The user who created this post." "The user who created this post."
author: Profile! author: Profile!
"All comments related to this post." "All comments related to this post."
@ -1402,6 +1543,7 @@ type Post {
content: String! content: String!
"Html formatted content." "Html formatted content."
contentFormatted: String! contentFormatted: String!
createdAt: ISO8601DateTime!
"Users that are watching this post" "Users that are watching this post"
follows( follows(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -1431,6 +1573,7 @@ type Post {
): ProfileConnection! ): ProfileConnection!
"The media tagged in this post." "The media tagged in this post."
media: Media media: Media
updatedAt: ISO8601DateTime!
} }
"The connection type for Post." "The connection type for Post."
@ -1453,7 +1596,8 @@ type PostEdge {
node: Post node: Post
} }
type ProMutation { type ProMutation implements WithTimestamps {
createdAt: ISO8601DateTime!
"Set the user's discord tag" "Set the user's discord tag"
setDiscord( setDiscord(
"Your discord tag (Name#1234)" "Your discord tag (Name#1234)"
@ -1466,27 +1610,32 @@ type ProMutation {
): SetMessagePayload ): SetMessagePayload
"End the user's pro subscription" "End the user's pro subscription"
unsubscribe: UnsubscribePayload unsubscribe: UnsubscribePayload
updatedAt: ISO8601DateTime!
} }
"A subscription to Kitsu PRO" "A subscription to Kitsu PRO"
type ProSubscription { type ProSubscription implements WithTimestamps {
"The account which is subscribed to Pro benefits" "The account which is subscribed to Pro benefits"
account: Account! account: Account!
"The billing service used for this subscription" "The billing service used for this subscription"
billingService: RecurringBillingService! billingService: RecurringBillingService!
createdAt: ISO8601DateTime!
"The tier of Pro the account is subscribed to" "The tier of Pro the account is subscribed to"
tier: ProTier! tier: ProTier!
updatedAt: ISO8601DateTime!
} }
"A company involved in the creation or localization of media" "A company involved in the creation or localization of media"
type Producer { type Producer implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The name of this production company" "The name of this production company"
name: String! name: String!
updatedAt: ISO8601DateTime!
} }
"A user profile on Kitsu" "A user profile on Kitsu"
type Profile { type Profile implements WithTimestamps {
"A short biographical blurb about this profile" "A short biographical blurb about this profile"
about: String about: String
"An avatar image to easily identify this profile" "An avatar image to easily identify this profile"
@ -1506,6 +1655,18 @@ type Profile {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): CommentConnection! ): CommentConnection!
createdAt: ISO8601DateTime!
"Favorite media, characters, and people"
favorites(
"Returns the elements in the list that come after the specified cursor."
after: String,
"Returns the elements in the list that come before the specified cursor."
before: String,
"Returns the first _n_ elements from the list."
first: Int,
"Returns the last _n_ elements from the list."
last: Int
): FavoriteConnection!
"People that follow the user" "People that follow the user"
followers( followers(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -1533,6 +1694,18 @@ type Profile {
id: ID! id: ID!
"The user library of their media" "The user library of their media"
library: Library! library: Library!
"A list of library events for this user"
libraryEvents(
"Returns the elements in the list that come after the specified cursor."
after: String,
"Returns the elements in the list that come before the specified cursor."
before: String,
"Returns the first _n_ elements from the list."
first: Int,
kind: [LibraryEventKind!],
"Returns the last _n_ elements from the list."
last: Int
): LibraryEventConnection!
"The user's general location" "The user's general location"
location: String location: String
"Media reactions written by this user." "Media reactions written by this user."
@ -1584,6 +1757,7 @@ type Profile {
slug: String slug: String
"The different stats we calculate for this user." "The different stats we calculate for this user."
stats: ProfileStats! stats: ProfileStats!
updatedAt: ISO8601DateTime!
"A fully qualified URL to the profile" "A fully qualified URL to the profile"
url: String url: String
"The character this profile has declared as their waifu or husbando" "The character this profile has declared as their waifu or husbando"
@ -1613,15 +1787,17 @@ type ProfileEdge {
} }
"The different types of user stats that we calculate." "The different types of user stats that we calculate."
type ProfileStats { type ProfileStats implements WithTimestamps {
"The total amount of anime you have watched over your whole life." "The total amount of anime you have watched over your whole life."
animeAmountConsumed: AnimeAmountConsumed! animeAmountConsumed: AnimeAmountConsumed!
"The breakdown of the different categories related to the anime you have completed" "The breakdown of the different categories related to the anime you have completed"
animeCategoryBreakdown: AnimeCategoryBreakdown! animeCategoryBreakdown: AnimeCategoryBreakdown!
createdAt: ISO8601DateTime!
"The total amount of manga you ahve read over your whole life." "The total amount of manga you ahve read over your whole life."
mangaAmountConsumed: MangaAmountConsumed! mangaAmountConsumed: MangaAmountConsumed!
"The breakdown of the different categories related to the manga you have completed" "The breakdown of the different categories related to the manga you have completed"
mangaCategoryBreakdown: MangaCategoryBreakdown! mangaCategoryBreakdown: MangaCategoryBreakdown!
updatedAt: ISO8601DateTime!
} }
type Query { type Query {
@ -1664,6 +1840,8 @@ type Query {
findCharacterBySlug(slug: String!): Character findCharacterBySlug(slug: String!): Character
"Find a single Library Entry by ID" "Find a single Library Entry by ID"
findLibraryEntryById(id: ID!): LibraryEntry findLibraryEntryById(id: ID!): LibraryEntry
"Find a single Library Event by ID"
findLibraryEventById(id: ID!): LibraryEvent
"Find a single Manga by ID" "Find a single Manga by ID"
findMangaById(id: ID!): Manga findMangaById(id: ID!): Manga
"Find a single Manga by Slug" "Find a single Manga by Slug"
@ -1766,7 +1944,8 @@ type Query {
} }
"A quote from a media" "A quote from a media"
type Quote { type Quote implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The lines of the quote" "The lines of the quote"
lines( lines(
@ -1781,6 +1960,7 @@ type Quote {
): QuoteLineConnection! ): QuoteLineConnection!
"The media this quote is excerpted from" "The media this quote is excerpted from"
media: Media! media: Media!
updatedAt: ISO8601DateTime!
} }
"The connection type for Quote." "The connection type for Quote."
@ -1804,14 +1984,16 @@ type QuoteEdge {
} }
"A line in a quote" "A line in a quote"
type QuoteLine { type QuoteLine implements WithTimestamps {
"The character who said this line" "The character who said this line"
character: Character! character: Character!
"The line that was spoken" "The line that was spoken"
content: String! content: String!
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The quote this line is in" "The quote this line is in"
quote: Quote! quote: Quote!
updatedAt: ISO8601DateTime!
} }
"The connection type for QuoteLine." "The connection type for QuoteLine."
@ -1835,11 +2017,13 @@ type QuoteLineEdge {
} }
"Information about a user session" "Information about a user session"
type Session { type Session implements WithTimestamps {
"The account associated with this session" "The account associated with this session"
account: Account account: Account
createdAt: ISO8601DateTime!
"The profile associated with this session" "The profile associated with this session"
profile: Profile profile: Profile
updatedAt: ISO8601DateTime!
} }
"Autogenerated return type of SetDiscord" "Autogenerated return type of SetDiscord"
@ -1857,10 +2041,12 @@ type SetMessagePayload {
} }
"A link to a user's profile on an external site." "A link to a user's profile on an external site."
type SiteLink { type SiteLink implements WithTimestamps {
"The user profile the site is linked to." "The user profile the site is linked to."
author: Profile! author: Profile!
createdAt: ISO8601DateTime!
id: ID! id: ID!
updatedAt: ISO8601DateTime!
"A fully qualified URL of the user profile on an external site." "A fully qualified URL of the user profile on an external site."
url: String! url: String!
} }
@ -1886,7 +2072,8 @@ type SiteLinkEdge {
} }
"The streaming company." "The streaming company."
type Streamer { type Streamer implements WithTimestamps {
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The name of the site that is streaming this media." "The name of the site that is streaming this media."
siteName: String! siteName: String!
@ -1901,6 +2088,7 @@ type Streamer {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): StreamingLinkConnection! ): StreamingLinkConnection!
updatedAt: ISO8601DateTime!
"Videos of the media being streamed." "Videos of the media being streamed."
videos( videos(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -1915,7 +2103,8 @@ type Streamer {
} }
"The stream link." "The stream link."
type StreamingLink implements Streamable { type StreamingLink implements Streamable & WithTimestamps {
createdAt: ISO8601DateTime!
"Spoken language is replaced by language of choice." "Spoken language is replaced by language of choice."
dubs: [String!]! dubs: [String!]!
id: ID! id: ID!
@ -1927,6 +2116,7 @@ type StreamingLink implements Streamable {
streamer: Streamer! streamer: Streamer!
"Languages this is translated to. Usually placed at bottom of media." "Languages this is translated to. Usually placed at bottom of media."
subs: [String!]! subs: [String!]!
updatedAt: ISO8601DateTime!
"Fully qualified URL for the streaming link." "Fully qualified URL for the streaming link."
url: String! url: String!
} }
@ -1951,15 +2141,17 @@ type StreamingLinkEdge {
node: StreamingLink node: StreamingLink
} }
type TitlesList { type TitlesList implements WithTimestamps {
"A list of additional, alternative, abbreviated, or unofficial titles" "A list of additional, alternative, abbreviated, or unofficial titles"
alternatives: [String!] alternatives: [String!]
"The official or de facto international title" "The official or de facto international title"
canonical: String canonical: String
"The locale code that identifies which title is used as the canonical title" "The locale code that identifies which title is used as the canonical title"
canonicalLocale: String canonicalLocale: String
createdAt: ISO8601DateTime!
"The list of localized titles keyed by locale" "The list of localized titles keyed by locale"
localized(locales: [String!]): Map! localized(locales: [String!]): Map!
updatedAt: ISO8601DateTime!
} }
"Autogenerated return type of Unsubscribe" "Autogenerated return type of Unsubscribe"
@ -1970,7 +2162,8 @@ type UnsubscribePayload {
} }
"The media video." "The media video."
type Video implements Streamable { type Video implements Streamable & WithTimestamps {
createdAt: ISO8601DateTime!
"Spoken language is replaced by language of choice." "Spoken language is replaced by language of choice."
dubs: [String!]! dubs: [String!]!
"The episode of this video" "The episode of this video"
@ -1982,6 +2175,7 @@ type Video implements Streamable {
streamer: Streamer! streamer: Streamer!
"Languages this is translated to. Usually placed at bottom of media." "Languages this is translated to. Usually placed at bottom of media."
subs: [String!]! subs: [String!]!
updatedAt: ISO8601DateTime!
"The url of the video." "The url of the video."
url: String! url: String!
} }
@ -2007,7 +2201,7 @@ type VideoEdge {
} }
"A manga volume which can contain multiple chapters." "A manga volume which can contain multiple chapters."
type Volume { type Volume implements WithTimestamps {
"The chapters in this volume." "The chapters in this volume."
chapters( chapters(
"Returns the elements in the list that come after the specified cursor." "Returns the elements in the list that come after the specified cursor."
@ -2019,6 +2213,7 @@ type Volume {
"Returns the last _n_ elements from the list." "Returns the last _n_ elements from the list."
last: Int last: Int
): ChapterConnection ): ChapterConnection
createdAt: ISO8601DateTime!
id: ID! id: ID!
"The isbn number of this volume." "The isbn number of this volume."
isbn: [String!]! isbn: [String!]!
@ -2030,6 +2225,7 @@ type Volume {
published: ISO8601Date published: ISO8601Date
"The titles for this chapter in various locales" "The titles for this chapter in various locales"
titles: TitlesList! titles: TitlesList!
updatedAt: ISO8601DateTime!
} }
enum AgeRating { enum AgeRating {
@ -2268,6 +2464,17 @@ input TitlesListInput {
localized: Map localized: Map
} }
input UpdateStatusByIdInput {
id: ID!
status: LibraryEntryStatus!
}
input UpdateStatusByMediaInput {
mediaId: ID!
mediaType: media_type!
status: LibraryEntryStatus!
}
"A date, expressed as an ISO8601 string" "A date, expressed as an ISO8601 string"
scalar Date scalar Date