Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: react native file upload support #3535

Open
fawzii0x3 opened this issue Mar 15, 2024 · 1 comment
Open

RFC: react native file upload support #3535

fawzii0x3 opened this issue Mar 15, 2024 · 1 comment
Labels
future 🔮 An enhancement or feature proposal that will be addressed after the next release hold ⚠️ This issue is accepted but no contributor is available yet or prerequisites must be fulfilled first.

Comments

@fawzii0x3
Copy link

P.s : I tried to fetch the image blob but it upload the file with 0kb

Summary

Suggesting the addition of file upload support within urql mutations, particularly focusing on compatibility with the Expo platform. By implementing this feature, developers using urql will have the ability to seamlessly handle file uploads in their GraphQL mutations, enhancing the platform's versatility and accommodating diverse application requirements.

Proposed Solution

To address this need, it's recommended to extend urql's mutation capabilities to facilitate file uploads, with special consideration for Expo compatibility. This could involve integrating Expo's file handling APIs or leveraging compatible JavaScript libraries tailored for React Native environments. The implementation should prioritize simplicity and clarity, ensuring that developers can easily incorporate file upload functionality into their urql mutations. Additionally, comprehensive documentation and practical examples will be essential to assist developers in effectively utilizing this feature.

Requirements

  • Integration with Expo's file handling APIs or compatible libraries.
  • Seamless compatibility with urql's existing mutation framework.
  • Detailed documentation and illustrative examples to guide developers in utilizing the file upload functionality within urql mutations.
@fawzii0x3 fawzii0x3 added the future 🔮 An enhancement or feature proposal that will be addressed after the next release label Mar 15, 2024
@kitten kitten added the hold ⚠️ This issue is accepted but no contributor is available yet or prerequisites must be fulfilled first. label Mar 15, 2024
@kitten
Copy link
Member

kitten commented Mar 15, 2024

This is more of a documentation task to be honest.

For example, to make streamed responses work on React Native some polyfills are needed to replace some broken/missing functionality in fetch on React Native:
Specifically to enable this, for instance, you'd need:

In fact, with the latter providing FormData and if Blob is around, this may already be enough to fix it, if react-native-fetch-api accepts FormData bodies.

So, all in all, all we can do is support the web platform and lean either on React Native aligning closer with web standards or lean on polyfills. Hence, it's more a matter of collecting research then creating documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future 🔮 An enhancement or feature proposal that will be addressed after the next release hold ⚠️ This issue is accepted but no contributor is available yet or prerequisites must be fulfilled first.
Projects
None yet
Development

No branches or pull requests

2 participants