I am experiencing a very strange problem and I can't begin to understand why it's happening.
I have multiple custom built websites (not built on shopify) that use the shopify api to pull in data. On the frontend of my sites I make an Ajax call to a php file on my server that grabs collections and their products using curl and shopify's GraphQL API.
This has been working for years and was literally working yesterday 1/18/23. Today, every site I do this for (4 sites, 4 separate shopify stores) they are all broken.
The strangest thing is if I run the file in the terminal it returns all the data. For some reason starting today, when the file is called through Ajax from the front end - all the data is null.
Here is an example of the php file. I removed the sensitive data: