Skip to content

Instantly share code, notes, and snippets.

@Sky-bits
Last active September 2, 2022 13:44
Show Gist options
  • Save Sky-bits/52322a0d12577e3949daf9243b8ea93c to your computer and use it in GitHub Desktop.
Save Sky-bits/52322a0d12577e3949daf9243b8ea93c to your computer and use it in GitHub Desktop.
const response = await client.query({
data: `mutation {
productCreate(input : { title: "gql product from app meta 33 "} )
{
product{id, description, mediaCount}
userErrors {
field
message
}
}
}
`,
});
# get the app data
query gettheappdata {
app{
id
appStoreAppUrl
}
}
# output shopify admin graphql
{
"data": {
"app": {
"id": "gid://shopify/App/2315872",
"appStoreAppUrl": null
}
},
"extensions": {
"cost": {
"requestedQueryCost": 1,
"actualQueryCost": 1,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 999,
"restoreRate": 50
}
}
}
}
# create app scropt tag
mutation { scriptTagCreate(input : {src:"https://gist.githubusercontent.com/sanjay-ios-io/5919a6de463cfd27f51b60d8401fadb9/raw/d364a4b9d0158e9d0dee7145e48f668126ffd60b/testjs.js" }) {
scriptTag {
#ScriptTag fields
id
src
displayScope
}
userErrors {
field
message
}
}
}
# get the app id
{
appInstallation {
id
}
}
# create the app meta filed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment