Hello,
I’ve been working with the primaryDomain api call and I’ve been having trouble because there is no way to test it without a live (paid) store because there’s no way to have a primary domain on a dev store. If there were some way to test it (perhaps returning the store name without .myshopify, it would be very helpful!
Thanks,
Beckett
const GET_SHOP_PRIMARY_DOMAIN = `
query {
shop {
primaryDomain {
url
host
}
}
}
`;
1 Like
Hey @Beckett_Oliphant!
I’m curious about the specific context of why you need a non-myshopify.com URL for testing. The development store does return the myshopify.com domain as the primary domain, so your query will work for the context of querying the primary domain.
If you’re looking for different URL structures to test with, you could explore setting up Markets with domain subfolders, which can give you URLs like /en-jp/
or /en-mx/
that might provide more varied testing scenarios.
If you’re specifically testing features that require a paid plan’s custom domain setup, you’d need to test that on a live store.
Hey Kyle, thanks for this.
I need my user’s primaryDomain because my app uses tracking links and users expect the links from my app creates to have their primary domain, not their myshopify domain. It’s not the biggest deal but I was literally unable to test the primaryDomain call or functionality without a prod store with a primary domain. This is true with any domain functionaliy like the DOMAIN/(UPDATE/CREATE/DELETE) webhooks as well. I just wanted to bring up the issue in case there was an easy fix, for now I will just have to stick with live store testing.
Thanks Beckett. Live testing would be needed for that, but I’ll make sure to note this down for our product team to consider for future updates. 