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:
+31
-35
@@ -115,7 +115,7 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime {
|
||||
Variables interface{} `json:"variables"`
|
||||
}{
|
||||
Query: `
|
||||
query($userId: Int, $mediaId: Int, $listType: MediaType) {
|
||||
query ($userId: Int, $mediaId: Int, $listType: MediaType) {
|
||||
MediaList(mediaId: $mediaId, userId: $userId, type: $listType) {
|
||||
id
|
||||
mediaId
|
||||
@@ -199,12 +199,12 @@ func (a *App) GetAniListItem(aniId int, login bool) AniListGetSingleAnime {
|
||||
isAdult
|
||||
}
|
||||
status
|
||||
startedAt{
|
||||
startedAt {
|
||||
year
|
||||
month
|
||||
day
|
||||
}
|
||||
completedAt{
|
||||
completedAt {
|
||||
year
|
||||
month
|
||||
day
|
||||
@@ -288,7 +288,7 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
|
||||
}{
|
||||
Query: `
|
||||
query ($search: String!, $listType: MediaType) {
|
||||
Page (page: 1, perPage: 100) {
|
||||
Page(page: 1, perPage: 100) {
|
||||
pageInfo {
|
||||
total
|
||||
currentPage
|
||||
@@ -296,7 +296,7 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
|
||||
hasNextPage
|
||||
perPage
|
||||
}
|
||||
media (search: $search, type: $listType) {
|
||||
media(search: $search, type: $listType) {
|
||||
id
|
||||
idMal
|
||||
title {
|
||||
@@ -328,10 +328,10 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
|
||||
trending
|
||||
favourites
|
||||
isFavourite
|
||||
relations{
|
||||
nodes{
|
||||
relations {
|
||||
nodes {
|
||||
id
|
||||
title{
|
||||
title {
|
||||
userPreferred
|
||||
romaji
|
||||
english
|
||||
@@ -339,23 +339,23 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
startDate{
|
||||
startDate {
|
||||
year
|
||||
month
|
||||
day
|
||||
}
|
||||
endDate{
|
||||
endDate {
|
||||
year
|
||||
month
|
||||
day
|
||||
}
|
||||
nextAiringEpisode{
|
||||
nextAiringEpisode {
|
||||
airingAt
|
||||
timeUntilAiring
|
||||
episode
|
||||
}
|
||||
airingSchedule{
|
||||
nodes{
|
||||
airingSchedule {
|
||||
nodes {
|
||||
id
|
||||
airingAt
|
||||
timeUntilAiring
|
||||
@@ -364,7 +364,7 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
|
||||
}
|
||||
}
|
||||
genres
|
||||
tags{
|
||||
tags {
|
||||
id
|
||||
name
|
||||
description
|
||||
@@ -374,7 +374,6 @@ func (a *App) AniListSearch(query string) (interface{}, error) {
|
||||
}
|
||||
isAdult
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
`,
|
||||
@@ -424,7 +423,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
|
||||
$listType: MediaType
|
||||
$status: MediaListStatus
|
||||
$sort: [MediaListSort]
|
||||
) {
|
||||
) {
|
||||
Page(page: $page, perPage: $perPage) {
|
||||
pageInfo {
|
||||
total
|
||||
@@ -469,10 +468,10 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
|
||||
trending
|
||||
favourites
|
||||
isFavourite
|
||||
relations{
|
||||
nodes{
|
||||
relations {
|
||||
nodes {
|
||||
id
|
||||
title{
|
||||
title {
|
||||
userPreferred
|
||||
romaji
|
||||
english
|
||||
@@ -480,23 +479,23 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
|
||||
}
|
||||
}
|
||||
}
|
||||
startDate{
|
||||
startDate {
|
||||
year
|
||||
month
|
||||
day
|
||||
}
|
||||
endDate{
|
||||
endDate {
|
||||
year
|
||||
month
|
||||
day
|
||||
}
|
||||
nextAiringEpisode{
|
||||
nextAiringEpisode {
|
||||
airingAt
|
||||
timeUntilAiring
|
||||
episode
|
||||
}
|
||||
airingSchedule{
|
||||
nodes{
|
||||
airingSchedule {
|
||||
nodes {
|
||||
id
|
||||
airingAt
|
||||
timeUntilAiring
|
||||
@@ -505,7 +504,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
|
||||
}
|
||||
}
|
||||
genres
|
||||
tags{
|
||||
tags {
|
||||
id
|
||||
name
|
||||
description
|
||||
@@ -550,7 +549,7 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) (An
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
Variables: Variables{
|
||||
Page: page,
|
||||
@@ -626,7 +625,7 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) (AniListGetS
|
||||
$notes: String
|
||||
$startedAt: FuzzyDateInput
|
||||
$completedAt: FuzzyDateInput
|
||||
) {
|
||||
) {
|
||||
SaveMediaListEntry(
|
||||
mediaId: $mediaId
|
||||
progress: $progress
|
||||
@@ -751,7 +750,7 @@ func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) (AniListGetS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
Variables: updateBody,
|
||||
}
|
||||
@@ -812,12 +811,8 @@ func (a *App) AniListDeleteEntry(mediaListId int) (DeleteAniListReturn, error) {
|
||||
Variables Variables `json:"variables"`
|
||||
}{
|
||||
Query: `
|
||||
mutation(
|
||||
$id:Int,
|
||||
){
|
||||
DeleteMediaListEntry(
|
||||
id:$id,
|
||||
){
|
||||
mutation ($id: Int) {
|
||||
DeleteMediaListEntry(id: $id) {
|
||||
deleted
|
||||
}
|
||||
}
|
||||
@@ -895,7 +890,8 @@ func (a *App) AniListBrowse(
|
||||
tags []string,
|
||||
excludedTags []string,
|
||||
minimumTagRank int,
|
||||
sort []string) (AniListCurrentUserWatchList, error) {
|
||||
sort []string,
|
||||
) (AniListCurrentUserWatchList, error) {
|
||||
// user := a.GetAniListLoggedInUser()
|
||||
type Variables struct {
|
||||
Page int `json:"page"`
|
||||
|
||||
Reference in New Issue
Block a user