mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Add findFiles and findFile graphql queries (#5941)
* Add findFile and findFiles * Add parent folder and zip file fields to file graphql types * Add parent_folder, zip_file fields to Folder graphql type * Add format to ImageFile type * Add format filter fields to image/video file filters
This commit is contained in:
23
internal/api/fields.go
Normal file
23
internal/api/fields.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/99designs/gqlgen/graphql"
|
||||
)
|
||||
|
||||
type queryFields []string
|
||||
|
||||
func collectQueryFields(ctx context.Context) queryFields {
|
||||
fields := graphql.CollectAllFields(ctx)
|
||||
return queryFields(fields)
|
||||
}
|
||||
|
||||
func (f queryFields) Has(field string) bool {
|
||||
for _, v := range f {
|
||||
if v == field {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user