commercetools / commercetools/sphere-node-sdk

Query params (non-predicate) via object notation

Open
#180 0 comments 0 reactions 0 assignees View on GitHub
Type: Enhancement
Dominant language
CoffeeScript
Stars
16
Forks
8
PR merge metrics
No merged PRs in 30d

Description

This is a feature request - please let me know if this is the wrong place to do this.

It would be great if the client was able to take query parameters from an object and serialize them as query params rather than the documented `byQueryString` method.

Something like this:

```js
client.products.withQuery({ offset: 50, limit: 50, sort: "product.createdAt asc" }).fetch()
```
which would build:

```js
/products?offset=50&limit=50&sort=product.createdAt%20asc
```

That way the client can validate the query params, enforce encoding rules and make the DSL simpler.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.