americanas-tech / restQL-golang

Microservice query language and platform
http://restql.b2w.io/
MIT License
17 stars 8 forks source link

List as a field on key-value structure always mutiplex #48

Closed rodrigodc07 closed 3 years ago

rodrigodc07 commented 3 years ago

On the key-value structure, if one of the fields of the structure is a list restQL automatically multiplex it, but we can't use no-multiplex function inside a key-value structure.

Exemple: Send the following body as a POST

{
  "hero": {
    "id": "123",
    "sidekicks": [
      "1",
      "2"
    ]
  }
}

Proposal:

to installment
    with
    hero = {
              id : "123",
              sidekicks : ["1","2"] -> no-multiplex
        }
caiorcferreira commented 3 years ago

Actually this is not really a bug but rather an expected but unsual result of two restQL features:

It is intentional that a user explode its object parameter and send it as a unique list to the API by disabling the multiplexing feature with the no-multiplex function.

However, today restQL do not support the case where a user don't want to explode his object parameter. I will introduce a pull request adding a no-explode function that should address this.