mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
142 lines
5.6 KiB
GraphQL
142 lines
5.6 KiB
GraphQL
"""
|
|
Represents a production with at least one opening or ending sequence.
|
|
|
|
For example, Bakemonogatari is an anime production with five opening sequences and one ending sequence.
|
|
"""
|
|
type Anime @model(class: "App\\Models\\Wiki\\Anime") {
|
|
"The primary key of the resource"
|
|
id: Int! @rename(attribute: "anime_id")
|
|
|
|
"The primary title of the anime"
|
|
name: String!
|
|
|
|
"The media format of the anime"
|
|
mediaFormat: AnimeMediaFormat @rename(attribute: "media_format") @deprecated(reason: "Use 'format' instead")
|
|
|
|
"The formatted string value of the mediaFormat field"
|
|
mediaFormatLocalized: String @localized @deprecated(reason: "Use 'formatLocalized' instead")
|
|
|
|
"The format of the anime"
|
|
format: AnimeFormat
|
|
|
|
"The formatted string value of the format field"
|
|
formatLocalized: String @localized
|
|
|
|
"The premiere season of the anime"
|
|
season: AnimeSeason
|
|
|
|
"The formatted string value of the season field"
|
|
seasonLocalized: String @localized
|
|
|
|
"The URL slug & route key of the resource"
|
|
slug: String!
|
|
|
|
"The brief summary of the anime"
|
|
synopsis: String
|
|
|
|
"The premiere year of the anime"
|
|
year: Int
|
|
|
|
"The date that the resource was created"
|
|
createdAt(format: String! = "Y-m-d H:i:s"): String @timestamp(attribute: "created_at")
|
|
|
|
"The date that the resource was updated"
|
|
updatedAt(format: String! = "Y-m-d H:i:s"): String @timestamp(attribute: "updated_at")
|
|
|
|
synonyms(
|
|
type: SynonymType @eq
|
|
where: _ @whereConditions(columnsEnum: SynonymFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [SynonymSort!] @sort
|
|
): [Synonym!]! @morphMany
|
|
|
|
animethemes(
|
|
type: ThemeType @eq
|
|
type_in: [ThemeType!] @in(key: "type")
|
|
sequence: Int @eq
|
|
sequence_lesser: Int @where(operator: "<", key: "sequence")
|
|
sequence_greater: Int @where(operator: ">", key: "sequence")
|
|
slug: String @eq
|
|
where: _ @whereConditions(columnsEnum: AnimeThemeFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [AnimeThemeSort!] @sort
|
|
): [AnimeTheme!]! @hasManyCustom(type: SIMPLE)
|
|
|
|
images(
|
|
facet: ImageFacet @eq
|
|
path_like: String @like(key: "path")
|
|
where: _ @whereConditions(columnsEnum: ImageFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [ImageSort!] @sort
|
|
): [Image!]! @belongsToManyCustom(type: CONNECTION, edgeType: "ImageEdge")
|
|
|
|
resources(
|
|
site: ResourceSite @eq
|
|
externalId: Int @eq(key: "external_id")
|
|
where: _ @whereConditions(columnsEnum: ExternalResourceFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [ExternalResourceSort!] @sort
|
|
): [ExternalResource!]! @belongsToManyCustom(type: CONNECTION, edgeType: "ExternalResourceEdge")
|
|
|
|
series(
|
|
name_like: String @like(key: "name")
|
|
where: _ @whereConditions(columnsEnum: SeriesFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [SeriesSort!] @sort
|
|
): [Series!]! @belongsToManyCustom(type: CONNECTION, edgeType: "AnimeSeriesEdge")
|
|
|
|
studios(
|
|
name_like: String @like(key: "name")
|
|
where: _ @whereConditions(columnsEnum: StudioFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [StudioSort!] @sort
|
|
): [Studio!]! @belongsToManyCustom(type: CONNECTION, edgeType: "AnimeStudioEdge")
|
|
}
|
|
|
|
type AnimeSeriesEdge @model(class: "App\\Pivots\\Wiki\\AnimeSeries") {
|
|
"The Series node."
|
|
node: Series!
|
|
|
|
"The date that the resource was created"
|
|
createdAt(format: String! = "Y-m-d H:i:s"): String @timestamp(attribute: "created_at")
|
|
|
|
"The date that the resource was updated"
|
|
updatedAt(format: String! = "Y-m-d H:i:s"): String @timestamp(attribute: "updated_at")
|
|
}
|
|
|
|
type AnimeStudioEdge @model(class: "App\\Pivots\\Wiki\\AnimeStudio") {
|
|
"The Studio node."
|
|
node: Studio!
|
|
|
|
"The date that the resource was created"
|
|
createdAt(format: String! = "Y-m-d H:i:s"): String @timestamp(attribute: "created_at")
|
|
|
|
"The date that the resource was updated"
|
|
updatedAt(format: String! = "Y-m-d H:i:s"): String @timestamp(attribute: "updated_at")
|
|
}
|
|
|
|
extend type Query {
|
|
"Returns an anime resource."
|
|
anime(slug: String! @eq): Anime @find(model: "App\\Models\\Wiki\\Anime")
|
|
|
|
"Filter anime by its external id on given site."
|
|
findAnimeByExternalSite(
|
|
site: ResourceSite!
|
|
id: [Int!]
|
|
link: String
|
|
): [Anime!]! @builder(method: "App\\GraphQL\\Builders\\FindAnimeByExternalSiteBuilder") @all
|
|
|
|
"Returns a listing of anime resources given fields."
|
|
animePagination(
|
|
id: Int @eq(key: "anime_id")
|
|
search: String @search
|
|
name: String @eq
|
|
name_like: String @like(key: "name")
|
|
mediaFormat: AnimeMediaFormat @eq(key: "media_format") @deprecated(reason: "Use 'format' instead")
|
|
mediaFormat_in: [AnimeMediaFormat!] @in(key: "media_format") @deprecated(reason: "Use 'format_in' instead")
|
|
format: AnimeFormat @eq
|
|
format_in: [AnimeFormat!] @in(key: "format")
|
|
season: AnimeSeason @eq
|
|
season_in: [AnimeSeason!] @in(key: "season")
|
|
slug: String @eq
|
|
year: Int @eq
|
|
year_lesser: Int @where(operator: "<", key: "year")
|
|
year_greater: Int @where(operator: ">", key: "year")
|
|
where: _ @whereConditions(columnsEnum: AnimeFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
|
sort: [AnimeSort!] @sort
|
|
): [Anime!]! @paginate
|
|
} |