openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

Add fallback value to requests

Open bryanjtc opened this issue 5 months ago • 0 comments

Describe the bug If a request fails react query throws this error because data cannot be undefined Query data cannot be undefined. Please make sure to return a value other than undefined from your query function

To Reproduce Steps to reproduce the behavior:

  1. Use any query generated by this tool and make it throw an error

OpenAPI spec file If possible, please upload the OpenAPI spec file.

Expected behavior Allow adding a fallback value like null, or an empty array or empty string

Screenshots image

  • OS: [e.g. macOS]
  • Version [e.g. v1.0.0]

Additional context Add any other context about the problem here.

bryanjtc avatar Sep 17 '24 14:09 bryanjtc