style(go): reformat embedded GraphQL queries with consistent indentation

Normalize the AniList GraphQL query strings in AniListFunctions.go
and AniListUserFunctions.go so every operation uses the same
indentation scheme: two-space steps, field and nested selection sets
uniformly indented, and keywords/arguments spaced consistently
(query ($search: String!), relations {, startDate {, etc.). Also
break the AniListBrowse parameter list onto its own trailing
parameter line for readability.

The queries themselves are unchanged - this is whitespace-only
normalization of the raw string literals, done with the new
project-local Neovim setup (.nvim.lua) that formats embedded GraphQL
via prettier. No behavior change; queries return identical results.
This commit is contained in:
John O'Keefe
2026-09-24 13:50:31 -04:00
parent c0885a4bd5
commit 79022c04a8
2 changed files with 486 additions and 490 deletions
+31 -35
View File
@@ -115,7 +115,7 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime {
Variables interface{} `json:"variables"` Variables interface{} `json:"variables"`
}{ }{
Query: ` Query: `
query($userId: Int, $mediaId: Int, $listType: MediaType) { query ($userId: Int, $mediaId: Int, $listType: MediaType) {
MediaList(mediaId: $mediaId, userId: $userId, type: $listType) { MediaList(mediaId: $mediaId, userId: $userId, type: $listType) {
id id
mediaId mediaId
@@ -199,12 +199,12 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime {
isAdult isAdult
} }
status status
startedAt{ startedAt {
year year
month month
day day
} }
completedAt{ completedAt {
year year
month month
day day
@@ -288,7 +288,7 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
}{ }{
Query: ` Query: `
query ($search: String!, $listType: MediaType) { query ($search: String!, $listType: MediaType) {
Page (page: 1, perPage: 100) { Page(page: 1, perPage: 100) {
pageInfo { pageInfo {
total total
currentPage currentPage
@@ -296,7 +296,7 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
hasNextPage hasNextPage
perPage perPage
} }
media (search: $search, type: $listType) { media(search: $search, type: $listType) {
id id
idMal idMal
title { title {
@@ -328,10 +328,10 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
trending trending
favourites favourites
isFavourite isFavourite
relations{ relations {
nodes{ nodes {
id id
title{ title {
userPreferred userPreferred
romaji romaji
english english
@@ -339,23 +339,23 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
} }
} }
} }
startDate{ startDate {
year year
month month
day day
} }
endDate{ endDate {
year year
month month
day day
} }
nextAiringEpisode{ nextAiringEpisode {
airingAt airingAt
timeUntilAiring timeUntilAiring
episode episode
} }
airingSchedule{ airingSchedule {
nodes{ nodes {
id id
airingAt airingAt
timeUntilAiring timeUntilAiring
@@ -364,7 +364,7 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
} }
} }
genres genres
tags{ tags {
id id
name name
description description
@@ -374,7 +374,6 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
} }
isAdult isAdult
} }
} }
} }
`, `,
@@ -424,7 +423,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
$listType: MediaType $listType: MediaType
$status: MediaListStatus $status: MediaListStatus
$sort: [MediaListSort] $sort: [MediaListSort]
) { ) {
Page(page: $page, perPage: $perPage) { Page(page: $page, perPage: $perPage) {
pageInfo { pageInfo {
total total
@@ -469,10 +468,10 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
trending trending
favourites favourites
isFavourite isFavourite
relations{ relations {
nodes{ nodes {
id id
title{ title {
userPreferred userPreferred
romaji romaji
english english
@@ -480,23 +479,23 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
} }
} }
} }
startDate{ startDate {
year year
month month
day day
} }
endDate{ endDate {
year year
month month
day day
} }
nextAiringEpisode{ nextAiringEpisode {
airingAt airingAt
timeUntilAiring timeUntilAiring
episode episode
} }
airingSchedule{ airingSchedule {
nodes{ nodes {
id id
airingAt airingAt
timeUntilAiring timeUntilAiring
@@ -505,7 +504,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
} }
} }
genres genres
tags{ tags {
id id
name name
description description
@@ -550,7 +549,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
} }
} }
} }
} }
`, `,
Variables: Variables{ Variables: Variables{
Page: page, Page: page,
@@ -626,7 +625,7 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) (AniListGetS
$notes: String $notes: String
$startedAt: FuzzyDateInput $startedAt: FuzzyDateInput
$completedAt: FuzzyDateInput $completedAt: FuzzyDateInput
) { ) {
SaveMediaListEntry( SaveMediaListEntry(
mediaId: $mediaId mediaId: $mediaId
progress: $progress progress: $progress
@@ -751,7 +750,7 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) (AniListGetS
} }
} }
} }
} }
`, `,
Variables: updateBody, Variables: updateBody,
} }
@@ -812,12 +811,8 @@ func (a *App) AniListDeleteEntry(mediaListId int) (DeleteAniListReturn, error) {
Variables Variables `json:"variables"` Variables Variables `json:"variables"`
}{ }{
Query: ` Query: `
mutation( mutation ($id: Int) {
$id:Int, DeleteMediaListEntry(id: $id) {
){
DeleteMediaListEntry(
id:$id,
){
deleted deleted
} }
} }
@@ -895,7 +890,8 @@ func (a *App) AniListBrowse(
tags []string, tags []string,
excludedTags []string, excludedTags []string,
minimumTagRank int, minimumTagRank int,
sort []string) (AniListCurrentUserWatchList, error) { sort []string,
) (AniListCurrentUserWatchList, error) {
// user := a.GetAniListLoggedInUser() // user := a.GetAniListLoggedInUser()
type Variables struct { type Variables struct {
Page int `json:"page"` Page int `json:"page"`