Class: Ecoportal::API::GraphQL::Mutation::FileContainer::Upload
- Inherits:
-
Logic::Mutation
- Object
- Logic::BaseQuery
- Logic::Mutation
- Ecoportal::API::GraphQL::Mutation::FileContainer::Upload
- Defined in:
- lib/ecoportal/api/graphql/mutation/file_container/upload.rb
Overview
Registers an object already uploaded to S3 as an org file container.
★ This is the REAL second half of a file upload, captured from the web client on
2026-07-30 (tmp/file_upload_network_log.har): the browser does
FileSignature (GraphQL) -> S3 multipart POST -> uploadFile (GraphQL) ->
updatePage. There is NO POST /api/v2/<org>/s3/files call and NO polling step —
the previous implementation was a port of ecoportal-api-v2's REST S3 code and
targeted endpoints the platform does not use for this flow.
url is the S3 object key returned by the upload step (NOT a URL, despite the name —
verified against the capture: uploads/<userId>/<stamp>-<token>-/<filename>).
Verified against the live schema (2026-07-30):
uploadFile(input: UploadInput) -> UploadPayload { clientMutationId errors item: FileContainer }
UploadInput { clientMutationId filename filetype filesize locationIds otherTags url containerId }
Instance Method Summary collapse
Methods inherited from Logic::Mutation
Instance Method Details
#query(filename:, filetype:, filesize:, url:, location_ids: nil, other_tags: nil, container_id: nil, **kargs, &block) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ecoportal/api/graphql/mutation/file_container/upload.rb', line 34 def query(filename:, filetype:, filesize:, url:, location_ids: nil, other_tags: nil, container_id: nil, **kargs, &block) input = { filename: filename, filetype: filetype, filesize: filesize.to_s, url: url } input[:locationIds] = Array(location_ids) if location_ids input[:otherTags] = Array() if input[:containerId] = container_id if container_id super(input: input, **kargs, &block) end |