How to prepare GraphQL query template for webhook configuration
Below, you can find GraphQL query templates for each entity. Use them to specify the data you want to include in the webhook payload.
GraphQL query templates for every entity
Event
{
operationName: null,
variables: {
"eventId": "%EVENT_ID%"
},
query: "query ($eventId: ID!) {event(id: $eventId) { <event_properties> }}"
}
Replace <event_properties>
with the properties from the event()
query in the GraphQL Playground.
Booking
{
operationName: null,
variables: {
"orderId": "%ORDER_ID%"
},
query: "query ($orderId: ID!) {order(id: $orderId) { <booking_properties> }}"
}
Replace <booking_properties>
with the properties from the order()
query in the GraphQL Playground.
Attendee
{
operationName: null,
variables: {
"attendeeId": "%ATTENDEE_ID%"
},
query: "query ($attendeeId: ID!) {attendee(id: $attendeeId) { <attendee_properties> }}"
}
Replace <attendee_properties>
with the properties from the attendee()
query in the GraphQL Playground.
Contact
{
operationName: null,
variables: {
"contactId": "%CONTACT_ID%"
},
query: "query ($contactId: ID!) {contact(id: $contactId) { <contact_properties> }}"
}
Replace <contact_properties>
with the properties from the contact()
query in the GraphQL Playground.
Invitee
{
operationName: null,
variables: {
"eventId": "%EVENT_ID%",
"contactId": "%CONTACT_ID%"
},
query: "query ($eventId: ID!, $contactId: ID!) {invitee(eventId: $eventId, contactId: $contactId) { <invitee_properties> }}"
}
Replace <invitee_properties>
with the properties from the invitee()
query in the GraphQL Playground.
Form
{
operationName: null,
variables: {
"formResponseId": "%FORM_RESPONSE_ID%"
},
query: "query ($formResponseId: ID!) {form(id: $formResponseId) { <form_properties> }}"
}
Replace <form_properties>
with the properties from the form()
query in the GraphQL Playground.
Message Recipient
{
operationName: null,
variables: {
"messageRecipientId": "%MESSAGE_RECIPIENT_ID%"
},
query: "query ($messageRecipientId: ID!) {messageRecipient(id: $messageRecipientId) { <message_recepient_properties> }}"
}
Replace <message_recepient_properties>
with the properties from the messageRecipient()
query in the GraphQL Playground.
Example
Example of the GraphQL query template to include event ID, title and organization name in the event webhook payload:
{
"operationName": null,
"variables": {
"eventId": "%EVENT_ID%"
},
"query": "query ($eventId: ID!) {event(id: $eventId) { id title organization {name} }}"
}
Here is the part where you define the event data you want to receive in the webhook payload: id title organization {name}