import_types Absinthe.Plug.Types
...
@desc "Test Upload a File"
field :test_upload, :string do
arg(:file, non_null(:upload))
resolve(fn args, _ ->
{:ok, "success"}
end)
end
Router
pipeline :graphql do
plug(Api.Web.Context)
end
# non authentication queries go through here
scope "/" do
pipe_through(:graphql)
post("/", Absinthe.Plug, schema: Api.Gql.Schemas.Api)
end
Your query isn’t valid GraphQL syntax. Also, you name the mutation field testUpload but call uploadTest. Try mutation { testUpload(file: \"metadata_json\") } for your query.
Edit: It looks like you have copied your code from the Absinthe docs, but the syntax there is wrong.