# event - admin-graphql - QUERY Version: 2024-10 ## Description Get a single event by its id. ### Access Scopes ## Arguments * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! - The ID of the event. ## Returns * [action](/docs/api/admin-graphql/2024-10/scalars/String): String! The action that occured. * [appTitle](/docs/api/admin-graphql/2024-10/scalars/String): String The name of the app that created the event. * [attributeToApp](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! Whether the event was created by an app. * [attributeToUser](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! Whether the event was caused by an admin user. * [createdAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! The date and time when the event was created. * [criticalAlert](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! Whether the event is critical. * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! A globally-unique ID. * [message](/docs/api/admin-graphql/2024-10/scalars/FormattedString): FormattedString! Human readable text that describes the event. ## Examples ### Retrieve the first basic-event 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 { event(id: \\\"gid://shopify/BasicEvent/422690323\\\") { id message ... on BasicEvent { action subjectType subject { __typename } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n event(id: \"gid://shopify/BasicEvent/422690323\") {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }`,\n});\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 event(id: \"gid://shopify/BasicEvent/422690323\") {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n event(id: \"gid://shopify/BasicEvent/422690323\") {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n event(id: \"gid://shopify/BasicEvent/422690323\") {\n id\n message\n ... on BasicEvent {\n action\n subjectType\n subject {\n __typename\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "event": { "id": "gid://shopify/BasicEvent/422690323", "message": "bob bobsen included a product on Online Store: IPod Nano - 8GB.", "action": "published", "subjectType": "PRODUCT", "subject": { "__typename": "Product" } } } } ### Retrieves a single event 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 EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/BasicEvent/267851118\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query EventShow($id: ID!) {\n event(id: $id) {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/BasicEvent/267851118\"\n },\n },\n});\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 EventShow($id: ID!) {\n event(id: $id) {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/BasicEvent/267851118\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query EventShow($id: ID!) {\n event(id: $id) {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/BasicEvent/267851118\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query EventShow($id: ID!) {\n event(id: $id) {\n id\n action\n createdAt\n message\n ... on BasicEvent {\n arguments\n subjectId\n subjectType\n additionalContent\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/BasicEvent/267851118" } #### Graphql Response { "data": { "event": { "id": "gid://shopify/BasicEvent/267851118", "action": "unpublished", "createdAt": "2006-06-09T12:00:00Z", "message": "", "arguments": [], "subjectId": "gid://shopify/Product/630255015", "subjectType": "PRODUCT", "additionalContent": "null" } } }