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

[graphiql] file upload support #3511

Open
Hebilicious opened this issue Jan 24, 2024 · 2 comments
Open

[graphiql] file upload support #3511

Hebilicious opened this issue Jan 24, 2024 · 2 comments

Comments

@Hebilicious
Copy link

Support File Upload within GraphiQL out of the box.

GraphQL Altair supports something like this :

image

Uploaded files can be given a name and are then injected as variables in the query, where the File type can be used (assuming the schema as the scalar for it)

Support for multiple files as well would be great.

@jaydenseric
Copy link

Here is the GraphQL multipart request specification:

https://github.com/jaydenseric/graphql-multipart-request-spec

A substantial number of GraphQL projects use this spec for file uploads in GraphQL operation variables, and for them GraphiQL is not a great option. Altair is going to make things a lot easier. It would be great to have more choice. The most recent iterations of the GraphiQL UI is quite nice and I would love to be able to use GraphiQL again after all these years if it can handle uploading blobs via Blob, File, or FileList in the GraphQL operation variables.

@acao
Copy link
Member

acao commented Feb 21, 2024

yes I have used it many times on both sides of the stack! this would be awesome to have. It has been requested before of course. The maintainer of Altair is a maintainer here as well! I think Apollo Studio or Workbench or whatever it's called also has support, I used it last year when we implemented your spec with nestjs.

i plan on making some improvements to the graphiql sdk later this year, but the goal would be to provide this via a plugin API, as many built in features will eventually become. in this case I think we also need to make the fetcher implementation pluggable as well. the biggest priority is still monaco of course. but I would love to do this right, and then make the other multipart spec we've implemented (IncrementalDelivery) a plugin as well

I haven't checked, but have you submitted this to the GraphQL over http spec working group @jaydenseric ? they can make the spec official. I know they created this WG years after you created your spec, I think I first implemented it end to end about 7 years ago. But the same was the case for some of relay's protocol specs which we've adopted, such as multipart incremental delivery via stream and defer. We have discussed making yours official before but no one has had time to take up the process of submiting it alongside other protocol spec work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants