Grapqhl call to Shopify.
Name | Type | Description | |
---|---|---|---|
query |
string
|
Graphql query with variables. |
|
variables |
object
|
Object with graphql query variables. |
// Query example
const query = `query {
shop {
name
primaryDomain {
url
host
}
}
}`;
const rest = Graphql.send(query, '');
object
Graphql response.
Adds a metafields to Shopify order. This function will add a metafield id to the payload if metafield already exits.
Name | Type | Description | |
---|---|---|---|
id |
string
|
Shopify Order ID. |
|
metafields |
Array.<Metafields>
|
Array of metafields. |
const shopifyOrderId = 1234;
const metafields = [{
namespace: "example",
key: "example_key",
value: "example_value"
}];
const response = Graphql.addOrUpdateMetafields(shopifyOrderId, metafields, "order");
Mesa.log.info('Graphql response: ', response);
object
Graphql response
Adds a metafield to a Shopify entity. This function will throw an error if metafield exists and you do not pass an id.
Name | Type | Description | |
---|---|---|---|
id |
string
|
Entity id. |
|
metafields |
Array.<Metafields>
|
Array of metafields. |
|
entity |
string
|
Entity: Order | Product |
Void
Builds Shopfiy Graphql id.
Name | Type | Description | |
---|---|---|---|
entity |
string
|
Shopfiy graphql entity. |
|
id |
string
|
Shopify entity id. |
string
Shopfiy graphql id
Metafields
Name | Type | Description | |
---|---|---|---|
id |
string
|
Metafield id. |
Optional |
key |
string
|
Metafield key. |
|
namespace |
string
|
Metafield namespace. |
|
value |
string
|
Metafield value. |
|
valueType |
string
|
Metafield value type. |
Optional |