Unable to convert Swagger 2.0 to GraphQL
See original GitHub issueI’m currently using swagger-to-graphql
and was hoping I could easily replace it with openapi-to-graphql
. I replaced the createSchema
call with createGraphQLSchema
and hoped for the best.
I got this error when I ran it:
UnhandledPromiseRejectionWarning: Could not convert Swagger to OpenAPI Specification. (Patchable) parameter.type is mandatory for non-body parameters
I’m using a Swagger 2.0 object and calling:
const { schema, report } = await createGraphQLSchema(swaggerObject);
Is there something I’m doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Not able to convert swagger openapi spec to GraphQL #64
Describe the bug oasgraph cli was not able to convert openapi spec to GraphQL To Reproduce oasgraph openapi.json Expected behavior GraphQL ...
Read more >Start with GraphQL today by converting your Swagger schema
This will execute queries using the generated GraphQL schema, whereas the default Apollo configuration assumes a remote GraphQL server.
Read more >IBM/openapi-to-graphql - Gitter
I have recently started working on converting an existing swagger 2.0 spec to graphql schema, Does openapi-to-graphql currently support ...
Read more >How can I run OpenAPI -> GraphQL conversion?
If your OAS (or swagger) is properly formed You can quickly have a GraphQL interface up and running in minutes.
Read more >GraphQL schema basics - Apollo GraphQL Docs
Your GraphQL server uses a schema to describe the shape of your available data ... If ! appears outside the square brackets, the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, should be: const { schema, report } = await createGraphQLSchema(swaggerObject, {swagger2OpenAPIOptions: { patch: true } });
That appears to have worked, ty @florin-f-manea!
Seems the documentation could benefit by having this included.