Document Formats
Document Formats are categories organizers assign to Documents (for example Presentation, Abstract, Poster, Handout). They group and order Documents in the Swapcard app, and control how many Documents each exhibitor can add.
A DocumentFormat belongs to a Community and is reused across its Events. It is linked to each Event where it is used, and that link carries the per-event settings: display order (index) and exhibitor document limit (limit). These settings are read through DocumentFormat.withEvent(eventId).
Every Document belongs to exactly one Format.
The 7 canonical types are: EXHIBITOR_DOCUMENTS_AND_LINKS, PRESENTATION, ABSTRACT, POSTER, HANDOUT, ARTICLE, JOB_OFFER.
Object
Fetch Document Formats
Use Event.documentFormats to list the Formats linked to an Event, ordered by index, or Community.documentFormats to list every Format of a Community, linked or not. Both fields are cursor-paginated and accept an optional search argument (case-insensitive match on the name). Event.documentFormats also accepts filter: { ids }.
Per-event settings and counts (limit, index, documentsCount) are read through withEvent(eventId), which returns null when the Format is not linked to that Event or you cannot access it. DocumentFormat.documentsCount counts the Format's Documents across all Events.
Query — per event
query EventDocumentFormats(
$eventId: ID!
$cursor: CursorPaginationInput
$search: String
) {
event(id: $eventId) {
documentFormats(cursor: $cursor, search: $search) {
pageInfo {
startCursor
endCursor
hasNextPage
hasPreviousPage
}
totalCount
nodes {
id
type
name
color
isDownloadable
clientId
translations {
language
name
}
withEvent(eventId: $eventId) {
limit
index
documentsCount
}
}
}
}
}
Variables
{
"eventId": "RXZlbnRfMQ==",
"cursor": { "first": 25 },
"search": "poster"
}
Query — per community
query CommunityDocumentFormats(
$communityId: ID!
$cursor: CursorPaginationInput
$search: String
) {
communities(filter: { ids: [$communityId] }) {
nodes {
id
documentFormats(cursor: $cursor, search: $search) {
pageInfo {
startCursor
endCursor
hasNextPage
}
totalCount
nodes {
id
type
name
clientId
documentsCount
linkedEventsCount
linkedEvents {
id
}
}
}
}
}
}
Fetch the Documents of a Format
In an Event
DocumentFormat.withEvent(eventId).documents lists the Documents assigned to a Format in an Event. It is cursor-paginated and accepts an optional search on the name.
query FormatDocuments($eventId: ID!, $cursor: CursorPaginationInput) {
event(id: $eventId) {
documentFormats(filter: { ids: ["RG9jdW1lbnRGb3JtYXRfNDI="] }) {
nodes {
id
name
withEvent(eventId: $eventId) {
documentsCount
documents(cursor: $cursor) {
pageInfo {
endCursor
hasNextPage
}
nodes {
id
translations {
language
name
}
exhibitors {
id
name
}
plannings {
id
title
}
}
}
}
}
}
}
}
Document.exhibitors and Document.plannings return the Exhibitors and Sessions a Document is attached to. Reached through an Event, as here, they only return those of that Event.
For an exhibitor or a session
documentFormats on ExhibitorWithEvent, PlanningWithEvent, Exhibitor and Planning returns their Documents grouped by Format, as a list of DocumentFormatGroup. Through withEvent(eventId), the groups follow the Event's Format order. Pass id to return a single Format.
On an exhibitor in an Event, canExhibitorManage is false when the exhibitor's resolved limit for the Format is 0: the exhibitor can no longer add, edit or delete Documents in it from the Swapcard app (see Exhibitor document limits). It stays true when a cap is reached; compare exhibitorLimit.used with exhibitorLimit.limit to know if the exhibitor can still add Documents. It is null outside an exhibitor in an Event.
query ExhibitorDocumentsByFormat($communityId: ID!, $exhibitorId: ID!, $eventId: ID!) {
exhibitorsV2(communityId: $communityId, filter: { ids: [$exhibitorId] }) {
nodes {
id
withEvent(eventId: $eventId) {
documentFormats {
format {
id
type
name
}
canExhibitorManage
documentsConnection(cursor: { first: 20 }) {
totalCount
nodes {
id
translations {
language
name
}
}
}
}
}
}
}
}
Assign a Document to a Format
Pass documentFormatId to createDocument or updateDocument. The Format must belong to the Document's Community and be linked to the Event(s) the Document belongs to. Otherwise, the mutation returns a BAD_INPUT error on documentFormatId, or a NOT_FOUND error when the Format does not exist. When documentFormatId is omitted on creation, the Document goes to the Community's default Presentation Format. See the Documents examples page.
Create, update, link and unlink in a single call
The importEventDocumentFormats mutation is the single entry point for all state changes on a Format against an Event: create a Format and link it, update an existing Format, apply per-event overrides, link to another event, unlink. It accepts a batch of inputs and returns a result per input with an inputId correlation.
Arguments
eventId— The Id of the Event the Formats operate against.formats— A list ofImportDocumentFormatInput. Each entry identifies a target Format (viaid,clientId, or neither for pure create) and declares what to do.validateOnly— Whentrue, runs the full validation pipeline without persisting (dry-run).
Each ImportDocumentFormatInput entry is routed as follows:
| Input shape | Resulting behavior |
|---|---|
{ create: {...} } | Create Format in the community and auto-link to eventId |
{ clientId: "FMT_X", create: {...} } | Same, with clientId persisted on the new Format. Fails with CLIENT_ID_ALREADY_IN_USE if a Format already uses this clientId |
{ clientId: "FMT_X", update: {...} } | Update the Format with this clientId. Fails if none exists |
{ clientId: "FMT_X", create: {...}, update: {...} } | Upsert: update the Format with this clientId, or create it with create if none exists |
{ id: X, update: {...} } | Update the Format's fields |
{ id: X } | Idempotent link: if the Format is not yet linked to the event, link it; else no-op |
{ id: X, eventLink: { limit, index } } | Set the per-event settings (links the Format first if needed) |
{ id: X, unlinkFromEvent: true } | Unlink the Format from the event (the Format stays in the community) |
eventLink.limit is the event-level limit of Documents each exhibitor can add in this Format from the Swapcard app: null means unlimited, 0 closes the Format to exhibitors, N is a cap. When omitted, an existing link keeps its value and a new link gets the type's default: unlimited for EXHIBITOR_DOCUMENTS_AND_LINKS, 0 for every other type. See Exhibitor document limits.
Whatever the input shape, a Format that is not yet linked to eventId gets linked to it, unless unlinkFromEvent is set.
Errors are reported per input on the result's errors[] field, with the inputId of the failing entry. Each input is saved on its own, so one failing input does not prevent the others from being saved.
Mutation
mutation ImportEventDocumentFormats(
$eventId: ID!
$formats: [ImportDocumentFormatInput!]!
$validateOnly: Boolean
) {
importEventDocumentFormats(
eventId: $eventId
formats: $formats
validateOnly: $validateOnly
) {
results {
inputId
documentFormat {
id
type
name
color
isDownloadable
clientId
translations {
language
name
}
withEvent(eventId: $eventId) {
limit
index
documentsCount
}
}
}
errors {
inputId
message
errorCode
path
}
documentFormatCreated
documentFormatUpdated
}
}