Skip to content

Add file upload functionality to Monday.com SDK#87

Merged
damian-rakus merged 14 commits intomainfrom
feature/damianra/support-file-uploads
Mar 18, 2026
Merged

Add file upload functionality to Monday.com SDK#87
damian-rakus merged 14 commits intomainfrom
feature/damianra/support-file-uploads

Conversation

@damian-rakus
Copy link
Copy Markdown
Collaborator

Summary

This PR adds comprehensive file upload functionality to the Monday.com SDK, enabling users to upload files via the API client using the GraphQL multipart request specification. The implementation automatically detects File and Blob objects in variables and converts requests to multipart/form-data format.

Changes

Core functionality:

  • lib/api-client.ts: Added complete file upload middleware that:
    • Automatically detects File/Blob objects in GraphQL variables
    • Converts requests to multipart/form-data following the GraphQL multipart spec
    • Recursively extracts files from nested objects and arrays
    • Properly handles the mapping between variables and form fields
    • Removes Content-Type header to allow browser to set correct boundary

Documentation:

  • README.md: Added comprehensive file upload usage examples and important notes about endpoint requirements
  • CHANGELOG.MD: Documented breaking changes and new features for v14.0.0

Package updates:

  • package.json:
    • Bumped version to 14.0.0
    • Increased minimum Node.js requirement to 18.0.0
    • Replaced nock with undici for testing

Testing:

  • tests/api-client.integration.test.ts: Complete rewrite using undici MockAgent instead of nock
  • Added comprehensive file upload integration tests covering:
    • Single file uploads
    • Multiple files in arrays
    • Nested files in objects
    • Mixed file and regular variables
    • Proper FormData structure validation
    • Header handling for multipart requests

Breaking changes:

  • Minimum Node.js version increased from 16.20.0 to 18.0.0
  • Test infrastructure migrated from nock to undici

The implementation is backward compatible for non-file requests and seamlessly handles file uploads when File or Blob objects are detected in the variables.

Monday.com Item

https://monday.com/boards/3544893369/pulses/10945935968

@damian-rakus damian-rakus merged commit 38e6c71 into main Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants