query
Lookup an App by ID or return the currently authenticated App.
- Get an app by its ID
- Get the currently authenticated app
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
app(id: "gid://shopify/App/193172482") {
title
}
}`,
);
const data = await response.json();
query {
app(id: "gid://shopify/App/193172482") {
title
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { app(id: \"gid://shopify/App/193172482\") { title } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
app(id: "gid://shopify/App/193172482") {
title
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
app(id: "gid://shopify/App/193172482") {
title
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
app(id: "gid://shopify/App/193172482") {
title
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"app": {
"title": "Invoicing Application"
}
}