mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix dataloaders not loading in js plugins (#3014)
* Include dataloaders in js plugin gql calls * Handle gql errors correctly in js plugins
This commit is contained in:
@@ -89,10 +89,11 @@ func gqlRequestFunc(ctx context.Context, vm *otto.Otto, cookie *http.Cookie, gql
|
||||
throw(vm, fmt.Sprintf("could not unmarshal object %s: %s", output, err.Error()))
|
||||
}
|
||||
|
||||
retErr, hasErr := obj["error"]
|
||||
retErr, hasErr := obj["errors"]
|
||||
|
||||
if hasErr {
|
||||
throw(vm, fmt.Sprintf("graphql error: %v", retErr))
|
||||
errOut, _ := json.Marshal(retErr)
|
||||
throw(vm, fmt.Sprintf("graphql error: %s", string(errOut)))
|
||||
}
|
||||
|
||||
v, err := vm.ToValue(obj["data"])
|
||||
|
||||
Reference in New Issue
Block a user