A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hey all,
A couple of years back I managed to cobble together a private app that gets and/or sets delivery profiles for products.
This app is now being flagged as per the warning in my subject line. I went into my code and changed the API endpoint from /admin/api/2020-04/graphql.json to /admin/api/2022-10/graphql.json
This seemed to make the warning disappear for a day or two but not it seems to be back and now I am concerned that what needs done next it rather more substantial.
The only additional information I can see is that it has a link to "Unsupported custom apps". https://help.shopify.com/en/manual/apps/unsupported-apps#unsupported-private-apps
As my app is a private app does this mean that it will just stop working on January 1st as per the warning?
If so does anyone know how I convert my private app to a custom app quickly? I went down the Private App path as someone had suggested it was easier to install than a custom app. The app is actually fairly straight forward, aside from the lines of PHP related to CURL there are only 2 queries which are called depending on a parameter that is sent to the app.
Thanks in advance.
Hi @garethrane 👋
Generally, the deprecation warnings are to notify you of breaking changes when migrating to a supported stable version of our APIs. Release notes are generally published a year in advance, and you can find the breaking changes for 2022-10 here. For apps created from the partner dashboard, you should be able to leverage the API health report here to check the status of your updated app as well. For apps created from the merchant admin, you can use the deprecated api calls endpoint to fetch a similar report.
As for supported/unsupported app types, it would be best if you would contact us here with your authenticated partner account with appropriate permissions (to store, app, etc) and provide the team with the app ID or API key for more insight.
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey there @ShopifyDevSup
Thanks for the response. I reached out to that partners support chat you mentioned. They mostly reiterated what you said above.
I'd like to use deprecated_api_calls to see why my app is being flagged. Are you able to help me with this?
Can I query this via the GraphiQL explorer? Or should I do this via code? If so how do I format my query?
Just to clarify, what I mean is I do not know how to query the deprecated_api_calls.json API.
I only have basic understanding of how this works.
Here is a simplified version of my code for connecting to GraphQL:
$our_endpoint = "https://12345abcdefg:shppa_12345@my-store.myshopify.com/admin/api/2022-10/graphql.json";
$curl = curl_init($our_endpoint);
$parentVarId = $_POST["parentVarID"];
$querty_alt = 'query { productVariant(id: "gid://shopify/ProductVariant/' . $parentVarId . '") { id deliveryProfile { id name } }}';
// Prepare Query to send
$post_data = array();
$post_data['query'] = $querty_alt;
$post_data = json_encode($post_data);
// Set the Curl
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
// Run the curl
$curl_response = curl_exec($curl);
curl_close($curl);
// Get the delivery profile gid
$response_array = json_decode($curl_response);
$delivery_profile_gid = $response_array->data->productVariant->deliveryProfile->id;
$arProfileGid["gid"] = $delivery_profile_gid;
// Send back to Shopify
echo json_encode($arProfileGid);
I am presuming I can swap out the endpoint to /admin/api/2022-10/deprecated_api_calls.json
But how do I format my query to get the correct response using CURL as I have done above for my Delivery Profile code?
Since the `/deprecated_api_calls.json` is a REST endpoint, you should be able to use the below curl request directly, or implement the same in your native php framework.
curl -L -X GET 'https://YOUR_STORE_NAME.myshopify.com/admin/api/2022-10/deprecated_api_calls.json' \
-H 'X-Shopify-Access-Token: YOUR_ADMIN_API_ACCESS_TOKEN'
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
And do I pass it the access token from my private app?
That's exactly right! The "YOUR_ADMIN_API_ACCESS_TOKEN" text should be replaced with the same access token that is used to send authenticated requests in your app. It usually takes the form of `shp.._a1b2c3d4...`.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
My private connects to GraphQL using https://{API Key}:{Shared Secret}@my-store-name.myshopify.com...
It doesn't actually have an access token. Or is the access token this: {API Key}:{Shared Secret}
It's a little challenging without knowing your app ID, but if your app was created from the merchant admin, you would be making authenticated requests with an access token similar to this example rather than using basic auth. If you have access to the merchant's admin, you can direct them to this help doc to get the API credentials for you, or help them to rotate the credentials as needed.
If you continue to have trouble, it may be easier to contact us here with your authenticated partner account so that we can take a closer look at your app in particular.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Ok, thank you. I was able to make a successful call using CURL.
It is telling that `Metafield.valueType` has been removed however the private app I wrote does not reference this at all.
This private app has 2 queries, or specifically 1 mutation (deliveryProfileUpdate) and 1 query. Neither of these have anything to do with meta data.
BUT I also wrote a custom app at the time which was installed properly as a custom app. This uses the metafields.json REST API and it does indeed reference the value_type parameter:
$meta_data = array(
'namespace' => 'seo',
'key' => 'hidden',
'value'=> 1,
'value_type'=> 'integer'
);
Could it actually be this that is triggering the deprecation warning??
I have changed my call from
$meta_data = array(
'namespace' => 'seo',
'key' => 'hidden',
'value'=> 1,
'value_type'=> 'integer'
);
To:
$meta_data = array(
'namespace' => 'seo',
'key' => 'hidden',
'value'=> 1,
'type'=> 'number_integer'
);
My code still works and is correctly adding the metafield. I changed this 2 nights ago but this morning when I checked the deprecated API call is said that "Metafield.valueType" is being called. How is possible? I have changed 'value_type' to 'type' and changed my value from 'integer' to 'numer_integer' as per the linked document in the deprecated API return call.