mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 21:16:30 +02:00
Fix GraphQL syntax, supply operation name
This commit is contained in:
parent
2d0d4546ec
commit
7041e37eea
@ -19,6 +19,7 @@ type addonSlugRequest struct {
|
|||||||
Variables struct {
|
Variables struct {
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
} `json:"variables"`
|
} `json:"variables"`
|
||||||
|
OperationName string `json:"operationName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// addonSlugResponse is received from the CurseProxy GraphQL api to get the id from a slug
|
// addonSlugResponse is received from the CurseProxy GraphQL api to get the id from a slug
|
||||||
@ -39,13 +40,12 @@ func modIDFromSlug(slug string) (int, error) {
|
|||||||
request := addonSlugRequest{
|
request := addonSlugRequest{
|
||||||
Query: `
|
Query: `
|
||||||
query getIDFromSlug($slug: String) {
|
query getIDFromSlug($slug: String) {
|
||||||
{
|
|
||||||
addons(slug: $slug) {
|
addons(slug: $slug) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
`,
|
`,
|
||||||
|
OperationName: "getIDFromSlug",
|
||||||
}
|
}
|
||||||
request.Variables.Slug = slug
|
request.Variables.Slug = slug
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user