File upload GraphQL api gives an error

Topic summary

A developer encountered an “access denied” error when attempting to use the fileCreate GraphQL mutation to upload files. The error message appeared garbled/reversed in the response.

Resolution:
The issue was resolved by adding the write_files access scope to the app’s permissions, as required by the Shopify Admin API documentation.

Follow-up questions:

  • Getting file IDs: After successful upload, file IDs can be retrieved by adding inline fragments to the query:

    ... on MediaImage { id }
    ... on GenericFile { id }
    
  • Related issue: Another user reported a “No such object” XML error when checking uploaded file URLs, suggesting potential problems with staged upload paths or file accessibility after creation.

Status: Original issue resolved; additional troubleshooting questions remain open regarding file ID retrieval and post-upload file access.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

@HendryRaudsepp , I am a fresher Shopify app. I have created an app for file upload using type script but get some errors when I am file uploading. so can you see and please tell me what I am missing? because the last few days I have been debugging but have not found any so please help me. I will share my code. I hope you check my please tell me. when I am resource URL check in the browser get an error XML related. “No such object: shopify-staged-uploads/tmp/86599663903/files/8436a409-6b08-4fb7-b706-6f5a76e64c47/Screenshot_from_2024-05-10_12-28-21.png”