Skip to content

DefaultDataForPath does not work for galleries #609

@valarauca

Description

@valarauca

Problem:

025-09-01 12:20:30Error   Gallery.Create.Post [Default Data For Path]: returned error: Error: graphQL query failed: 422 - {"errors":[{"message":"Variable \"$id\" of type \"ID\" used in position expecting type \"ID!\".","locations":[{"line":1,"column":49}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}},{"message":"Cannot query field \"path\" on type \"Gallery\". Did you mean \"paths\" or \"date\"?","locations":[{"line":1,"column":63}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}],"data":null}. Query: query findGallery($id: ID) {    findGallery(id: $id) {        path    }}. Variables: map[id:179] at github.com/stashapp/stash/pkg/javascript.(*GQL).AddToVM.(*GQL).gqlRequestFunc.func1 (native)

Cause

function getGalleryPath(ID) {
  var query =
    "\
query findGallery($id: ID) {\
    findGallery(id: $id) {\
        path\
    }\
}";

Why?

There are actually 2 issues here

Problem 1: findGallery takes a ID! not ID

Problem 2: findGallery returns Gallery which has not path variable.

  • The closest approximation would likely be path within the Folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions