Hi!
API version 2025-01.
We are using fileCreate
request fileCreate - GraphQL Admin in one of our custom apps to add images to Files.
In some cases, we need to overwrite an existing image and we want to use duplicateResolutionMode
with REPLACE
value to do it.
But there is a problem and the request is not working as it is described in the documentation.
When we pass REPLACE the request itself returns a 200 response. But the array is empty.
- Does not add new files.
- Does not replace old files.
- It just returns an empty array.
RAISE_ERROR
works, but it does not report an error (for example: image exists), but just says upload failed, which is very uninformative.
Has anyone encountered similar issues or knows a way how to make REPLACE work?
Thank you!
Philip
5 Likes
Hi Philip,
The issue you’re encountering with the fileCreate
mutation and the duplicateResolutionMode
set to REPLACE
might be related to specific requirements or constraints not being met. Here are some key points and suggestions to address the problem:
Key Considerations for duplicateResolutionMode: REPLACE
- Filename Requirement: When using
REPLACE
, the filename
field must be provided. If this is missing, the mutation will not function as expected. The error code MISSING_FILENAME_FOR_DUPLICATE_MODE_REPLACE
is relevant here.
- File Status: The
fileStatus
field in the response indicates whether the file processing was successful. Ensure you check this field to confirm the file’s readiness.
- User Errors: The
userErrors
field in the response provides detailed error messages. If the array is empty, it might indicate that the mutation was processed but did not meet the conditions for replacing the file.