--- title: event - GraphQL Admin description: Get a single event by its id. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/event?example=retrieves-a-single-event md: https://shopify.dev/docs/api/admin-graphql/latest/queries/event.md?example=retrieves-a-single-event --- # event query Get a single event by its id. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the event. *** ## Possible returns * Event [Event](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Event) Events chronicle resource activities such as the creation of an article, the fulfillment of an order, or the addition of a product. *** ## Examples * ### Retrieve the first basic-event #### Description Retrieve an event by its id. #### Query ```graphql query { event(id: "gid://shopify/BasicEvent/422690323") { id message ... on BasicEvent { action subjectType subject { __typename } } } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { event(id: \"gid://shopify/BasicEvent/422690323\") { id message ... on BasicEvent { action subjectType subject { __typename } } } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { event(id: "gid://shopify/BasicEvent/422690323") { id message ... on BasicEvent { action subjectType subject { __typename } } } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby 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 { event(id: "gid://shopify/BasicEvent/422690323") { id message ... on BasicEvent { action subjectType subject { __typename } } } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { event(id: "gid://shopify/BasicEvent/422690323") { id message ... on BasicEvent { action subjectType subject { __typename } } } }`, }); ``` #### Response ```json { "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 #### Query ```graphql query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } } ``` #### Variables ```json { "id": "gid://shopify/BasicEvent/267851118" } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }", "variables": { "id": "gid://shopify/BasicEvent/267851118" } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }`, { variables: { "id": "gid://shopify/BasicEvent/267851118" }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby 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 EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } } QUERY variables = { "id": "gid://shopify/BasicEvent/267851118" } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }`, "variables": { "id": "gid://shopify/BasicEvent/267851118" }, }, }); ``` #### Response ```json { "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" } } ``` [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20EventShow\(%24id%3A%20ID!\)%20%7B%0A%20%20event\(id%3A%20%24id\)%20%7B%0A%20%20%20%20id%0A%20%20%20%20action%0A%20%20%20%20createdAt%0A%20%20%20%20message%0A%20%20%20%20...%20on%20BasicEvent%20%7B%0A%20%20%20%20%20%20arguments%0A%20%20%20%20%20%20subjectId%0A%20%20%20%20%20%20subjectType%0A%20%20%20%20%20%20additionalContent%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22id%22%3A%20%22gid%3A%2F%2Fshopify%2FBasicEvent%2F267851118%22%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }`, { variables: { "id": "gid://shopify/BasicEvent/267851118" }, }, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }", "variables": { "id": "gid://shopify/BasicEvent/267851118" } }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }`, { variables: { "id": "gid://shopify/BasicEvent/267851118" }, }, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } }`, "variables": { "id": "gid://shopify/BasicEvent/267851118" }, }, }); ``` ##### Ruby ``` 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 EventShow($id: ID!) { event(id: $id) { id action createdAt message ... on BasicEvent { arguments subjectId subjectType additionalContent } } } QUERY variables = { "id": "gid://shopify/BasicEvent/267851118" } response = client.query(query: query, variables: variables) ``` ## Input variables JSON ```json { "id": "gid://shopify/BasicEvent/267851118" } ``` ## Response JSON ```json { "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" } } ```