A bit confused with API endpoints, as well as question about ios SDK

_SC_
New Member
4 0 0

Good morning, folks. I am playing with StoreFront API and I am a bit confused with the API end points.

I created a storefront in private mode on around Aug 5, 2020. Added one product in there and tried to access the item using Storefront API. 

From GraphiQL, it appears the following URL works:

  https://<mystore>.myshopify.com/api/graphql.json

  https://<mystore>.myshopify.com/api/graphql

  https://<mystore>.myshopify.com/api/2020-07/graphql.json

But these two does not work

    https://<mystore>.myshopify.com/api/2020-07/graphql

    https://<mystore>.myshopify.com/api/2020-04/graphql

What is going on?  

---

Now, one additional problem I see is that in the ios StoreFront API SDK, 

extension Storefront {

    enum Schema {

        static let version = "2020-04"

    }

}

 

In the file Graph.Client, I see the following line.

    self.apiURL  = Client.urlFor(shopDomain, path: "/api/\(Storefront.Schema.version)/graphql")

(Edit) Will this ever work? Since in my other testing /api/2020-04/graphql is not a working URL.

-------------

One more question, in the ios SDK, how are one supposed to add X-Shopify-Storefront-Access-Token header in the request object? There should be a handle for unit testing in my opinion.

 

I am not sure how could it work. Please help!

 

Thanks,

 

 

 

0 Likes