A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Shopify App Store requirements state that a merchant should only be able to install a publicly listed app through the Shopify App Store and not from anywhere else. I have a use case wherein I enable some functionality, post app installation, of my app through my backend and for that I need to know whether my app is installed on a given shop or not.
Is there a way where I can get this by making a request to some API or something like that, rather than manually downloading the list from the partners dashboard.
I tried solving this using the Partners Graph QL Api with the query -
{ app(id: partnerId) { id name events(first: 1, shopId: shopId) { edges { node { type app { id } occurredAt shop { id name myshopifyDomain } } } } } }
This works but the only issue is that I dont have the shop id with me, all I have is my shopify domain of a shop, so is there a way where I can get the shop ID of a shop using just the my shopify domain of the shop without having Access token for that shop.
Any help will be highly appreciated.
Have you got any solution for this, please post solution if you have any, Thanks
Hi, I am also looking for this. Any update about this..?
Hi @hitanshu88,
maybe the following query to the partner api is useful for you
query getCustomerList($id:ID!,$occurredAtMin:DateTime!, $cursor: String!){
app(id: $id) {
name
apiKey
id
events(first: 100,
after: $cursor,
occurredAtMin: $occurredAtMin,
types:[RELATIONSHIP_UNINSTALLED,RELATIONSHIP_INSTALLED,RELATIONSHIP_DEACTIVATED,RELATIONSHIP_REACTIVATED])
{
edges {
node {
occurredAt
shop {
name
id
myshopifyDomain
}
type
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
}
}
}
}
sadly,
{
"errors": [
{
"message": "Field 'events' doesn't exist on type 'App'",
"locations": [
{
"line": 6,
"column": 5
}
],
"path": [
"query",
"app",
"events"
],
"extensions": {
"code": "undefinedField",
"typeName": "App",
"fieldName": "events"
}
}
]
}