From fa8d7d1bc826883a98cb5698f0a3801a70062fe7 Mon Sep 17 00:00:00 2001 From: Gykes <24581046+Gykes@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:05:21 -0800 Subject: [PATCH] initial --- graphql/stash-box/query.graphql | 9 ++++ pkg/stashbox/graphql/generated_client.go | 62 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/graphql/stash-box/query.graphql b/graphql/stash-box/query.graphql index 99d2c8f4a..2367e85cf 100644 --- a/graphql/stash-box/query.graphql +++ b/graphql/stash-box/query.graphql @@ -176,6 +176,15 @@ query FindTag($id: ID, $name: String) { } } +query QueryTags($input: TagQueryInput!) { + queryTags(input: $input) { + count + tags { + ...TagFragment + } + } +} + mutation SubmitFingerprint($input: FingerprintSubmission!) { submitFingerprint(input: $input) } diff --git a/pkg/stashbox/graphql/generated_client.go b/pkg/stashbox/graphql/generated_client.go index e2a18352e..640a1c893 100644 --- a/pkg/stashbox/graphql/generated_client.go +++ b/pkg/stashbox/graphql/generated_client.go @@ -18,6 +18,7 @@ type StashBoxGraphQLClient interface { FindSceneByID(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*FindSceneByID, error) FindStudio(ctx context.Context, id *string, name *string, interceptors ...clientv2.RequestInterceptor) (*FindStudio, error) FindTag(ctx context.Context, id *string, name *string, interceptors ...clientv2.RequestInterceptor) (*FindTag, error) + QueryTags(ctx context.Context, input TagQueryInput, interceptors ...clientv2.RequestInterceptor) (*QueryTags, error) SubmitFingerprint(ctx context.Context, input FingerprintSubmission, interceptors ...clientv2.RequestInterceptor) (*SubmitFingerprint, error) Me(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*Me, error) SubmitSceneDraft(ctx context.Context, input SceneDraftInput, interceptors ...clientv2.RequestInterceptor) (*SubmitSceneDraft, error) @@ -643,6 +644,24 @@ func (t *FindStudio_FindStudio_StudioFragment_Parent) GetName() string { return t.Name } +type QueryTags_QueryTags struct { + Count int "json:\"count\" graphql:\"count\"" + Tags []*TagFragment "json:\"tags\" graphql:\"tags\"" +} + +func (t *QueryTags_QueryTags) GetCount() int { + if t == nil { + t = &QueryTags_QueryTags{} + } + return t.Count +} +func (t *QueryTags_QueryTags) GetTags() []*TagFragment { + if t == nil { + t = &QueryTags_QueryTags{} + } + return t.Tags +} + type Me_Me struct { Name string "json:\"name\" graphql:\"name\"" } @@ -775,6 +794,17 @@ func (t *FindTag) GetFindTag() *TagFragment { return t.FindTag } +type QueryTags struct { + QueryTags QueryTags_QueryTags "json:\"queryTags\" graphql:\"queryTags\"" +} + +func (t *QueryTags) GetQueryTags() *QueryTags_QueryTags { + if t == nil { + t = &QueryTags{} + } + return &t.QueryTags +} + type SubmitFingerprint struct { SubmitFingerprint bool "json:\"submitFingerprint\" graphql:\"submitFingerprint\"" } @@ -1736,6 +1766,37 @@ func (c *Client) FindTag(ctx context.Context, id *string, name *string, intercep return &res, nil } +const QueryTagsDocument = `query QueryTags ($input: TagQueryInput!) { + queryTags(input: $input) { + count + tags { + ... TagFragment + } + } +} +fragment TagFragment on Tag { + name + id +} +` + +func (c *Client) QueryTags(ctx context.Context, input TagQueryInput, interceptors ...clientv2.RequestInterceptor) (*QueryTags, error) { + vars := map[string]any{ + "input": input, + } + + var res QueryTags + if err := c.Client.Post(ctx, "QueryTags", QueryTagsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + const SubmitFingerprintDocument = `mutation SubmitFingerprint ($input: FingerprintSubmission!) { submitFingerprint(input: $input) } @@ -1838,6 +1899,7 @@ var DocumentOperationNames = map[string]string{ FindSceneByIDDocument: "FindSceneByID", FindStudioDocument: "FindStudio", FindTagDocument: "FindTag", + QueryTagsDocument: "QueryTags", SubmitFingerprintDocument: "SubmitFingerprint", MeDocument: "Me", SubmitSceneDraftDocument: "SubmitSceneDraft",