API Extremely slow using GraphQL with Unity

Shopify Partner
10 0 0

I'm running a Unity app, and only requesting 8 (yes only 8!) products at a time. The current time is around 10 SECONDS to get my data back. Granted these products have about 20 variants a piece, this still doesn't seem like it should take more than a second a product. I'm using the standard Shopify Unity Buy SDK, but under the hood it's just calling the GraphQL API. 

 

My request is: 

 

"{nodes (ids:[\"<Product1-ID>=\",\"<Product2-ID>=\",\"<Product3-ID>=\",\"<Product4-ID>=\",\"<Product5-ID>=\",\"<Product6-ID>=\",\"<Product7-ID>=\",\"<Product8-ID>=\"]){__typename ...on Product{id title description descriptionHtml options {name values }variants (first:250){edges {node {id availableForSale image {altText transformedSrc transformedSrc___pico:transformedSrc (maxWidth:16,maxHeight:16)transformedSrc___icon:transformedSrc (maxWidth:32,maxHeight:32)transformedSrc___thumb:transformedSrc (maxWidth:50,maxHeight:50)transformedSrc___small:transformedSrc (maxWidth:100,maxHeight:100)transformedSrc___compact:transformedSrc (maxWidth:160,maxHeight:160)transformedSrc___medium:transformedSrc (maxWidth:240,maxHeight:240)transformedSrc___large:transformedSrc (maxWidth:480,maxHeight:480)transformedSrc___grande:transformedSrc (maxWidth:600,maxHeight:600)transformedSrc___resolution_1024:transformedSrc (maxWidth:1024,maxHeight:1024)transformedSrc___resolution_2048:transformedSrc (maxWidth:2048,maxHeight:2048)}price title weight selectedOptions {name value }metafields (first:250){edges {node {description id key namespace value valueType }cursor }pageInfo {hasNextPage }}weightUnit }cursor }pageInfo {hasNextPage }}collections (first:250){edges {node {id title updatedAt }cursor }pageInfo {hasNextPage }}images (first:250){edges {node {altText transformedSrc transformedSrc___pico:transformedSrc (maxWidth:16,maxHeight:16)transformedSrc___icon:transformedSrc (maxWidth:32,maxHeight:32)transformedSrc___thumb:transformedSrc (maxWidth:50,maxHeight:50)transformedSrc___small:transformedSrc (maxWidth:100,maxHeight:100)transformedSrc___compact:transformedSrc (maxWidth:160,maxHeight:160)transformedSrc___medium:transformedSrc (maxWidth:240,maxHeight:240)transformedSrc___large:transformedSrc (maxWidth:480,maxHeight:480)transformedSrc___grande:transformedSrc (maxWidth:600,maxHeight:600)transformedSrc___resolution_1024:transformedSrc (maxWidth:1024,maxHeight:1024)transformedSrc___resolution_2048:transformedSrc (maxWidth:2048,maxHeight:2048)}cursor }pageInfo {hasNextPage }}metafields (first:250){edges {node {description id key namespace value valueType }cursor }pageInfo {hasNextPage }}}}}"

Now I do query some metafields, but even without those my response is just as long. The responding file is about 600kb, so I don't expect it to be instant but 10 seconds is a bit ridiculous. This is running on my PC with 200Mb internet. 

 

For the Unity folks, I've tried both a WWW and UnityWebRequest object, with the same behavior. 

 

Any thoughts?

 

0 Likes