Skip to main content

Documents

Swapcard supports different formats of Documents (Documents (.doc and .docx), Presentations (.ppt and .pptx), Images (.png and .jpg), PDF files) for an Event.

Once you have imported a Document into the platform, a URL link is automatically associated with this file. This link allows you to download/display the Document when you click on it.

Object

Fetch the first hundred Documents

This query can be used to fetch the first 100 Documents from an Event.

Arguments

  • eventId - The Id of the Event on which the Documents needs to be searched.

Query

query EventDocuments($eventId: ID!, $page: Int!) {
event(id: $eventId) {
documents(page: $page, pageSize: 100) {
pageInfo {
endCursor
totalItems
}
results {
description
id
name
type
url
}
}
}
}

Variables

{
"eventId": "RXZlbnRfMQ==",
"page": 1
}

Create Document

This mutation can be used to create a Document in an Event on Swapcard platform.

Arguments

  • eventId - The Id of the Event on which the Document needs to be created.
  • document - The Document object contains basic details about the Document.

Query

mutation CreateEventDocument($eventId: ID!, $document: CreateDocumentInput! ){
createEventDocument(eventId: $eventId, document: $document) {
description
id
name
type
url
}
}

Variables

{
"eventId": "RXZlbnRfNTUxMDI0",
"document": {
"name": "test-document",
"url": "https://www.testdocument.com/links/TestPDFfile.pdf",
"description": "this is a test document"
}
}

Update Document

This mutation can be used to update a Document in an Event.

Arguments

  • eventId- The Id of the Event on which the Document needs to be updated.
  • document - The Document object contains basic details about the Document.
  • documentId - The Id of the Document that needs to be updated.

Query

mutation UpdateEventDocument($eventId: ID!, $document: UpdateDocumentInput!, $documentId: ID!) {
updateEventDocument(eventId: $eventId, document: $document, id: $documentId) {
description
id
name
type
url
}
}

Variables

{
"eventId": "RXZlbnRfNTUxMDI0",
"documentId":"RG9jdW1lbnRfNTY1Mzky",
"document": {
"name": "test-document-update",
"url": "https://www.testdocument.com/links/UpdatedTestPDFfile.pdf",
"description": "this is an updated test document"
}
}

Delete Documents

This mutation can be used to delete Document in an Event.

Arguments

  • eventId - The Id of the Event on which the Documents need to be deleted.
  • documentIds - The Ids of the Documents that need to be deleted. This is an array and can hold more than one value separated by commas.

Query

mutation DeleteEventDocument($eventId: ID!, $documentIds: [ID!]!) {
deleteEventDocument(eventId: $eventId, ids: $documentIds)
}

Variables

{
"eventId": "RXZlbnRfNTUxMDI0",
"documentIds":["RG9jfNTY1Mzky","RG9jdW1lbnRMzky"]
}