swagger-to-graphql icon indicating copy to clipboard operation
swagger-to-graphql copied to clipboard

Support of file types

Open yarax opened this issue 7 years ago • 12 comments

yarax avatar May 10 '17 10:05 yarax

@yarax - any pointers to start this enhancement ?

machbio avatar Aug 05 '17 14:08 machbio

I'm still not sure how to handle this. Passing multipart data to GraphQL is quite tricky. So ideas and PRs are appreciated

yarax avatar Aug 05 '17 18:08 yarax

Maybe swagger-to-graphql should skip it (try-catch) it for now?

KrzysztofKarol avatar Sep 12 '17 09:09 KrzysztofKarol

In graphql-yoga, we use apollo-upload-server. It would be great if the generated schema would be compatible with that, for easy delegation.

kbrandwijk avatar Jan 28 '18 15:01 kbrandwijk

Is there anyway to get around this? I was all excited to find this tool (Trying to proof of concept graphQl vs Rest) but I'm getting the Error: Cannot build primitive type "file" error when doing command line.

fishgills avatar Jan 30 '18 00:01 fishgills

Try this gist[1] out and let me know if it works for you: https://gist.github.com/4F2E4A2E/d8da9003f561762a6b4631efbeb2e5e1

4F2E4A2E avatar Jan 30 '18 05:01 4F2E4A2E

@kbrandwijk then library will be coupled with apollo stack. As far as I know there are no official suggestions from official GraphQL contributors to support file types so far

yarax avatar Jan 30 '18 08:01 yarax

@yarax I agree, it's just one possible implementation, requiring client and server to use the same library, and both are apollo. So it should definitely not be the standard approach. However, just throwing an error is also not an option. So I would say: either ignore, or provide an opt-in for the (afaik) only common GraphQL implementation for files, even though it's not part of the spec...

kbrandwijk avatar Jan 31 '18 03:01 kbrandwijk

Ignoring file types is already implemented. Actually supporting file types will be tracked in this issue.

0xR avatar Sep 28 '19 16:09 0xR

using openapi 3.0.0

if a schema contains application/pdf i get this error: {"errors":[{"message":"Cannot read property 'schema' of undefined"}]}

where if the schema contains: multipart/form-data {"errors":[{"message":"Unsupported content type(s) found: multipart/form-data"}]}

mina-mina avatar Jun 29 '20 03:06 mina-mina

Ignoring file types is already implemented. Actually supporting file types will be tracked in this issue.

@0xR How can we ignore file types exactly? I have these errors and I'd like to bypass these errors.

gablabelle avatar Mar 05 '21 11:03 gablabelle

Any updates on this? I am also getting Unsupported content type(s) found: multipart/form-data.

dancomanlive avatar Jun 10 '21 20:06 dancomanlive