Closed CalvinQuark closed 1 year ago
JSON serialization stripping out null properties seems to be the root cause.
According to ChatGPT-4, in GraphQL if an argument is optional, "the client should not be required to include it in the query". If so, then this is an issue for the Azure Data API Builder team rather than for the ChilliCream/StrawberryShake team. Consequently, I have posted the issue there.
Product
Strawberry Shake
Is your feature request related to a problem?
There is a compatibility issue when using a ChilliCream StrawberryShake generated client to fetch data from an Azure Data API Builder CLI-generated GraphQL endpoint.
If a query is defined with an optional
$filter
parameter such as:When a
null
value is passed tofilter
parameter via a ChilliCream StrawberryShake-generated client query's.ExecuteAsync(filter: null)
method, the request does not include the"filter": null
node in thevariables
section:Unfortunately, the Azure Data API Builder CLI's GraphQL endpoint responds to this request with:
unless the
null
-valuedfilter
variable is specifically included in the request payload. I.e., this works:I haven't discovered a workaround for this issue either on the client side with StrawberryShake or on the server side with Azure Data API Builder. Is there a way to coax the StrawberryShake-generated Client to include the unused null
filter
variable?The solution you'd like
OOB compatibility between ChilliCream StrawberryShake generated clients and Azure Data API Builder CLI-generated GraphQL endpoints.