app Installationquery
query
2024-10latest
Lookup an AppInstallation by ID or return the AppInstallation for the currently authenticated App.
Arguments
ID used to lookup AppInstallation.
Was this section helpful?
AppInstallation possible returns
Anchor to AppInstallationAppInstallation Represents an installed application on a shop.
Was this section helpful?
Code examples for QUERY: appInstallation
Query Reference for QUERY: appInstallation
"{\n appInstallation {\n # AppInstallation fields\n }\n}"
Input Reference for QUERY: appInstallation
Schema Reference for QUERY: appInstallation
Display Examples for QUERY: appInstallation
[ { "example": { "type_name": "appinstallation", "title": "Get a metafield attached to an app installation", "description": "Get the metafield value identified by `secret_keys.api_key` on a specific app installation.", "query_string": "query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n}", "variables": { "namespace": "secret_keys", "key": "api_key", "ownerId": "gid://shopify/AppInstallation/1002334195" }, "response": { "data": { "appInstallation": { "apiKey": { "value": "aSBhbSBhIHNlY3JldCBrZXk=" } } } }, "api_name": "admin", "minimum_api_version": "2022-04", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "maximum_api_version": null, "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) { appInstallation(id: $ownerId) { apiKey: metafield(namespace: $namespace, key: $key) { value } } }\",\n \"variables\": {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n {\n variables: {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY\n\nvariables = {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n \"variables\": {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY;\n\n$variables = [\n \"namespace\" => \"secret_keys\",\n \"key\" => \"api_key\",\n \"ownerId\" => \"gid://shopify/AppInstallation/1002334195\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [] }, { "example": { "type_name": "appinstallation", "title": "Get metafields attached to an app installation", "description": "Get a page of metafields attached to a specific app installation.", "query_string": "query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n}", "variables": { "ownerId": "gid://shopify/AppInstallation/1002334195" }, "response": { "data": { "appInstallation": { "metafields": { "edges": [ { "node": { "namespace": "secret_keys", "key": "api_key", "value": "aSBhbSBhIHNlY3JldCBrZXk=" } } ] } } } }, "api_name": "admin", "minimum_api_version": "2022-04", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "maximum_api_version": null, "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query AppInstallationMetafields($ownerId: ID!) { appInstallation(id: $ownerId) { metafields(first: 3) { edges { node { namespace key value } } } } }\",\n \"variables\": {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"ownerId\" => \"gid://shopify/AppInstallation/1002334195\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [] }, { "example": { "type_name": "appinstallation", "title": "Get the URL used to launch the application", "description": "The following query retrieves the launchUrl associated with the appInstallation.", "query_string": "query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n}", "query_arguments": { "id": "gid://shopify/AppInstallation/1002334195" }, "response": { "data": { "appInstallation": { "launchUrl": "https://snowdevil.myshopify.com/admin/api_permissions/1002334195/redirect" } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/1002334195\\\") { launchUrl } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "id", "description": "ID used to lookup AppInstallation.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "ID", "isDeprecated": false, "deprecationReason": null }, "key": "id", "argValue": " \"gid://shopify/AppInstallation/1002334195\"", "typeKind": "QUERY" } ] }, { "example": { "type_name": "appinstallation", "title": "Get the URL used to uninstall the application", "description": "The following query retrieves the uninstallUrl associated with the appInstallation.", "query_string": "query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n}", "query_arguments": { "id": "gid://shopify/AppInstallation/688276949" }, "response": { "data": { "appInstallation": { "uninstallUrl": null } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/688276949\\\") { uninstallUrl } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "id", "description": "ID used to lookup AppInstallation.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "ID", "isDeprecated": false, "deprecationReason": null }, "key": "id", "argValue": " \"gid://shopify/AppInstallation/688276949\"", "typeKind": "QUERY" } ] }, { "example": { "type_name": "appinstallation", "title": "Get the access scopes associated with the app installation", "description": "The following query returns all the access scopes that were granted to the application during installation.", "query_string": "query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n}", "query_arguments": { "id": "gid://shopify/AppInstallation/1002334195" }, "response": { "data": { "appInstallation": { "accessScopes": [ { "handle": "write_content", "description": "Modify store content like articles, blogs, comments, pages, and redirects" }, { "handle": "write_themes", "description": "Modify theme templates and theme assets" }, { "handle": "write_products", "description": "Modify products, variants, and collections" }, { "handle": "write_customers", "description": "Modify customer details and customer groups" }, { "handle": "write_orders", "description": "Modify orders, transactions, and fulfillments" }, { "handle": "write_script_tags", "description": "Modify script tags in your store's theme template files" }, { "handle": "write_shipping", "description": "Modify shipping rates, countries, and provinces" }, { "handle": "read_content", "description": "Read store content like articles, blogs, comments, pages, and redirects" }, { "handle": "read_themes", "description": "Read theme templates and theme assets" }, { "handle": "read_products", "description": "Read products, variants, and collections" }, { "handle": "read_customers", "description": "Read customer details and customer groups" }, { "handle": "read_orders", "description": "Read orders, transactions, and fulfillments" }, { "handle": "read_script_tags", "description": "Read script tags in your store's theme template files" }, { "handle": "read_shipping", "description": "Read shipping rates, countries, and provinces" } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/1002334195\\\") { accessScopes { handle description } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "id", "description": "ID used to lookup AppInstallation.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "ID", "isDeprecated": false, "deprecationReason": null }, "key": "id", "argValue": " \"gid://shopify/AppInstallation/1002334195\"", "typeKind": "QUERY" } ] }, { "example": { "type_name": "appinstallation", "title": "Get the active subscriptions for the app installation", "description": "The following query returns the IDs of the active subscriptions billed by the application. Returns an \"access denied\" error if the user is not allowed to approve application charges.", "query_string": "query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n}", "query_arguments": { "id": "gid://shopify/AppInstallation/881878037" }, "response": { "data": { "appInstallation": { "activeSubscriptions": [ { "id": "gid://shopify/AppSubscription/1029266946" } ] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/881878037\\\") { activeSubscriptions { id } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "id", "description": "ID used to lookup AppInstallation.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "ID", "isDeprecated": false, "deprecationReason": null }, "key": "id", "argValue": " \"gid://shopify/AppInstallation/881878037\"", "typeKind": "QUERY" } ] }, { "example": { "type_name": "appinstallation", "title": "Get the app associated with the installation", "description": "The following query retrieves the application associated with the installation, returning the associated ID.", "query_string": "query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n}", "query_arguments": { "id": "gid://shopify/AppInstallation/1002334195" }, "response": { "data": { "appInstallation": { "app": { "id": "gid://shopify/App/1002334195" } } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/apps/test/unit/graph_api/admin/app_installation_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/1002334195\\\") { app { id } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "id", "description": "ID used to lookup AppInstallation.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "ID", "isDeprecated": false, "deprecationReason": null }, "key": "id", "argValue": " \"gid://shopify/AppInstallation/1002334195\"", "typeKind": "QUERY" } ] } ]