switch (topic) {
…
case “CHECKOUTS_CREATE”:
if (admin) {
admin.graphql.query(query here...)
}
…
I assumed that I could use the graphql client here, but I get a TS error Argument of type 'string' is not assignable to parameter of type 'GraphqlParams'.
OK, so for some reason the admin.graphql that comes back from authenticate.webhook is different than what comes back from authenticate.admin. If I pass {data: "query here..."} this works. Now I just need to craft the right query.
I have spent so long trying to figure out how to make admin graphQL calls from a webhook, and your answer solved it. Sincerely, thank you so much for sharing.
PS: Why there doesn’t seem to be anything about this in the docs is beyond me!