8000 GitHub - fubar-coder/graphql-dotnet-upload at a86177c5312e4e8a22644d847c4abbbd611953dc
[go: up one dir, main page]

Skip to content

Experimental middleware and an Upload scalar to add support for GraphQL multipart requests for ASP.NET Core

License

Notifications You must be signed in to change notification settings

fubar-coder/graphql-dotnet-upload

Repository files navigation

graphql-dotnet-upload

This repository contains an experimental implementation of the GraphQL multipart request spec based on ASP.NET Core.

Test it

Take a look at the tests and the sample and run some of the curl requests the spec lists if you are curious.

cURL

CMD:

curl localhost:54234/graphql ^
	-F operations="{ \"query\": \"mutation($file: Upload) { singleUpload(file: $file){ name }}\", \"variables\": { \"file\": null }}" ^
	-F map="{\"0\":[\"variables.file\"]}" ^
	-F 0=@a.txt

Bash:

curl localhost:54234/graphql \
  -F operations='{ "query": "mutation ($file: Upload!) { singleUpload(file: $file) { id } }", "variables": { "file": null } }' \
  -F map='{ "0": ["variables.file"] }' \
  -F 0=@a.txt

This middleware implementation only parses multipart requests. The sample app uses additional middleware that handles other cases (e.g. POST with application/json).

Roadmap

  • Make sure the implementation behaves according to the spec
  • Add convenience extension methods for ServiceCollection and ApplicationBuilder that register the neccessary types
  • Feature parity with the reference implementation
  • End to end sample with web based client

About

Experimental middleware and an Upload scalar to add support for GraphQL multipart requests for ASP.NET Core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%
0