publish to online store

This commit is contained in:
Ben Miller
2024-11-16 20:26:34 -07:00
parent 531da95091
commit 475eee70ea
3 changed files with 83 additions and 21 deletions

View File

@ -770,7 +770,7 @@ export class ShopifyProductsQuery {
} else {
queryText = `, query: "${query}"`
}
this.GQL = `{
this.GQL = /* GraphQL */ `{
products(first: ${pageSize}${cursorText}${queryText}) {
edges {
node {
@ -810,27 +810,29 @@ export class ShopifyProductsResponse {
}
export class ShopifyProductSetQuery {
GQL = `mutation setProduct($productSet: ProductSetInput!) {
productSet(input: $productSet) {
product {
id
}
productSetOperation {
id
status
userErrors {
code
field
message
GQL = /* GraphQL */ `
mutation setProduct($productSet: ProductSetInput!) {
productSet(input: $productSet) {
product {
id
}
productSetOperation {
id
status
userErrors {
code
field
message
}
}
userErrors {
code
field
message
}
}
}
userErrors {
code
field
message
}
}
}`
`
JSON: JSON
constructor(product: ShopifyProductSetInput, synchronous: boolean = true) {
let j = `{
@ -887,7 +889,7 @@ export class VariantOptionValueInput {
optionName?: string
}
function formatGqlForJSON(gql: string) {
export function formatGqlForJSON(gql: string) {
let singleLine = gql.split("\n").join(" ").replace(/\s+/g, " ")
return JSON.stringify(singleLine)
}