{"id":21503252,"url":"https://github.com/shavit/absinthe-upload","last_synced_at":"2025-07-15T23:31:22.281Z","repository":{"id":57478715,"uuid":"312450559","full_name":"shavit/absinthe-upload","owner":"shavit","description":"Absinthe plug to support Apollo upload format","archived":false,"fork":false,"pushed_at":"2020-11-16T16:56:36.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T16:42:52.665Z","etag":null,"topics":["absinthe-graphql","absinthe-plug","elixir"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/absinthe_upload","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shavit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-13T02:21:04.000Z","updated_at":"2023-06-21T14:16:51.000Z","dependencies_parsed_at":"2022-09-17T04:20:21.621Z","dependency_job_id":null,"html_url":"https://github.com/shavit/absinthe-upload","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shavit/absinthe-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavit%2Fabsinthe-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavit%2Fabsinthe-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavit%2Fabsinthe-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavit%2Fabsinthe-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shavit","download_url":"https://codeload.github.com/shavit/absinthe-upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavit%2Fabsinthe-upload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263727987,"owners_count":23502409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["absinthe-graphql","absinthe-plug","elixir"],"created_at":"2024-11-23T18:20:42.324Z","updated_at":"2025-07-15T23:31:22.024Z","avatar_url":"https://github.com/shavit.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AbsintheUpload\n\n[![Build Status](https://travis-ci.org/shavit/absinthe-upload.svg?branch=master)](https://travis-ci.org/shavit/absinthe-upload)\n\n\u003e Absinthe plug to support Apollo upload format\n\n## Installation\n\nIf [available in Hex](https://hexdocs.pm/absinthe_upload), the package can be installed\nby adding `absinthe_upload` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:absinthe_upload, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm/absinthe_upload). Once published, the docs can\nbe found at [https://hexdocs.pm/absinthe_upload](https://hexdocs.pm/absinthe_upload).\n\nAdd the plug to a Phoenix app:\n```\n# phoenix_app_web/router.ex\ndefmodule PhoenixAppWeb.Router do\n  use PhoenixAppWeb, :router\n  \n  pipeline :api do\n    plug(:accepnts, [\"json\"])\n\t\n\tplug(Absinthe.Upload)\n\t...\n\n  scope \"/graphql\" do\n    \n\tforward(\"/\", Absinthe.Plug,\n\t...\n```\n\nAdd the plug to a Plug router:\n```\n# app/router.ex\ndefmodule App.Router do\n\n  plug(Absinthe.Upload)\n  ...\n```\n\n## Example\n\nRequests with file uploads from Apollo clients has `\"map\"` and `\"operations\"`\n```\n%{\n  \"0\" =\u003e %Plug.Upload{\n    content_type: \"text/rtf\",\n    filename: \"San Francisco.rtf\",\n    path: \"/tmp/plug-1605/multipart-1605199833-755605321722586-2\"\n  },\n  \"map\" =\u003e \"{\\\"0\\\":[\\\"variables.attachment\\\"]}\",\n  \"operations\" =\u003e \"{\\\"query\\\":\\\"mutation DemoUpload($attachment: Upload) {\\\\n  demoUpload(attachment: $attachment)\\\\n}\\\",\\\"variables\\\":{\\\"attachment\\\":null},\\\"operationName\\\":\\\"DemoUpload\\\"}\"\n}\n```\n\nThe plug will transform the request to a format Absinthe understands\n```\n%{\n  \"attachment\" =\u003e %Plug.Upload{\n    content_type: \"text/rtf\",\n    filename: \"San Francisco.rtf\",\n    path: \"/tmp/plug-1605/multipart-1605199833-755605321722586-2\"\n  },\n  \"query\" =\u003e \"mutation DemoUpload($attachment: Upload) {  demoUpload(attachment: $attachment)}\"\n}\n```\n\n## Test\n\n```\nMIX_ENV=test mix test --cover\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshavit%2Fabsinthe-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshavit%2Fabsinthe-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshavit%2Fabsinthe-upload/lists"}