Does the map method work in the url?

I’m attempting to add a connector to an oData endpoint, and need to craft a URL that includes a filter with multiple “OR” statements based on an input [String].

Needs to look like:
/product?filter=(name eq “product1” OR name eq “product2” …)

Where the product names are in an input of type [String!] named “products”.

I’m curious if it is possible to use the map method in the the url:
http: {
GET: “/product?filter=(${args.input.products product →
map({ ‘product_name eq product OR’})
})”
}

I haven’t gone too far down this road, but I assume that the methods only work within the context of field mapping, not URL construction.

Hi Andy!

You can use methods in URLs as long as they result in a scalar value (for now). One example is ->jsonStringify:

GET: "/foo?json={$args.input->jsonStringify}"

A ->join method is definitely on our roadmap too. ->join(' OR ') would get you part of the way there.

Thanks for the great example — this looks especially relevant for batching, which we’re working on right now. I’ll put together some proposals on how we could handle this use case and get back to you!