IBM / openapi-to-graphql

Translate APIs described by OpenAPI Specifications (OAS) into GraphQL
https://developer.ibm.com/open/projects/openapi-to-graphql/
MIT License
1.6k stars 206 forks source link

DELETE method endpoints are missing in generated Graphql schema #405

Open anuraggo opened 3 years ago

anuraggo commented 3 years ago

Hello,

While converting to graphql, I see that only GET and POST method endpoints are available in graphql schema and DELETE endpoints are missing. Please assist on how to get all the endpoints in generated schema.

Alan-Cha commented 3 years ago

@anuraggo Sorry for the late reply. This is very interesting. I will need to verify this issue but my first thought is that perhaps this is an issue with a DELETE operation not having a response schema, which would result in skipping the operation.

Do you have a sample OAS for me to try?

anuraggo commented 3 years ago

Hi @Alan-Cha ,

Yes, you're right. The DELETE operation doesn't have response schema. Still I would think that library should have an option to generate endpoints for this case where there is no response schema. Let me know your thoughts on this.

delete: tags:

hongdeyuan commented 2 years ago

You can solve it by setting this property: fillEmptyResponses:true

openapiToGraphql.createGraphQLSchema(oas, {
  viewer: false,
  fillEmptyResponses: true,
})