swagger-to-graphql
swagger-to-graphql copied to clipboard
Support of file types
@yarax - any pointers to start this enhancement ?
I'm still not sure how to handle this. Passing multipart data to GraphQL is quite tricky. So ideas and PRs are appreciated
Maybe swagger-to-graphql should skip it (try-catch) it for now?
In graphql-yoga
, we use apollo-upload-server
. It would be great if the generated schema would be compatible with that, for easy delegation.
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.
Try this gist[1] out and let me know if it works for you: https://gist.github.com/4F2E4A2E/d8da9003f561762a6b4631efbeb2e5e1
@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 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...
Ignoring file types is already implemented. Actually supporting file types will be tracked in this issue.
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"}]}
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.
Any updates on this? I am also getting Unsupported content type(s) found: multipart/form-data.