Successfully cURL graphql orders with a filter query

There are examples of using the graphql orders API in the API docs: https://shopify.dev/docs/api/admin-graphql/2024-01/queries/orders?example=Get+the+first+10+orders+with+authorized+payments

I can curl successfully if I don’t include a query, but once I include a query I always get a 400. I’ve tried different combinations of double quotes, single quotes, escaping, etc. with no luck. Anyone manage to successfully use a filter with curl? I’ve used a GET request with orders.json successfully using the same filter, so the data is there, but I can’t seem to use graphql to get it.

I happened to look at this again. Seems it is due to the newlines in the curl request body. Maybe this is iTerm adding some invisible characters when I paste the examples. If I remove all newlines from the example query (and escape the double quotes) then it works.