Hi, thanks for any help you may offer. Any idea how to submit a Mutate request?
I looked here at the mutations example but surely I missed something or wrongfully applied the logic because I cannot get it to work: https://github.com/shurcooL/graphql
import (
"context"
"fmt"
shopifygraphql "github.com/r0busta/go-shopify-graphql"
"github.com/shurcooL/graphql"
)
func main() {
// Create client
opts := []shopifygraphql.Option{
shopifygraphql.WithVersion("2020-07"),
shopifygraphql.WithPrivateAppAuth("myappkey", "myapppass"),
}
client := shopifygraphql.NewClient("myshopify", opts...)
type InventoryAdjustQuantityInput struct {
InventoryLevelId graphql.String
AvailableDelta graphql.Int
}
var m struct {
InventoryAdjustQuantity struct {
InventoryLevel struct {
ID graphql.String
}
} `graphql:"inventoryAdjustQuantity(input: $input)"`
}
vars := map[string]interface{}{
"input": InventoryAdjustQuantityInput{
InventoryLevelId: graphql.String("gid://shopify/Product/5544934473882"),
AvailableDelta: graphql.Int(5),
},
}
err := client.Mutate(context.Background(), &m, vars)
if err != nil {
panic(err)
}
fmt.Printf("Inventory adjusted %v\n", m.InventoryAdjustQuantity.InventoryLevel.ID)
}