Korrigiere Shopify GraphQL Request Payload
This commit is contained in:
@@ -107,7 +107,11 @@ function shopify_graphql_query(array $env, string $query, array $variables = [])
|
|||||||
|
|
||||||
$credentials = shopify_api_credentials($env);
|
$credentials = shopify_api_credentials($env);
|
||||||
$token = shopify_api_access_token($env);
|
$token = shopify_api_access_token($env);
|
||||||
$body = json_encode(['query' => $query, 'variables' => $variables], JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES);
|
$request = ['query' => $query];
|
||||||
|
if ($variables !== []) {
|
||||||
|
$request['variables'] = $variables;
|
||||||
|
}
|
||||||
|
$body = json_encode($request, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES);
|
||||||
$response = shopify_api_request_json(
|
$response = shopify_api_request_json(
|
||||||
'https://' . $credentials['shop'] . '/admin/api/' . $credentials['api_version'] . '/graphql.json',
|
'https://' . $credentials['shop'] . '/admin/api/' . $credentials['api_version'] . '/graphql.json',
|
||||||
'POST',
|
'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user