americanas-tech / restQL-golang

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

API response being changed unintentionally #41

Open ricardoekm opened 3 years ago

ricardoekm commented 3 years ago

It seems that if an API response field value matches with a chained request parameter, restQL replaces the response value by the chained parameter.

Original call to the API: http://localhost:8000/dataset/customers

Original response:

{
  "filters": [],
  "id": "customers"
}

restQL query:

from app
    with
        id = "myApp"

from dataset
    with 
        id = app.layers.dataset

restQL response

{
  "app": {
    "details": {
      "status": 200,
      "success": true,
      "metadata": {}
    },
    "result": {
        ...
    }
  },
  "dataset": {
    "details": {
      "status": 200,
      "success": true,
      "metadata": {}
    },
    "result": {
      "filters": [],
      "id": "[app layers dataset]",
    }
  }
}
ricardoekm commented 3 years ago

The chained parameters were wrong, perhaps we could just check why when the variable is not resolved restQL is forwarding the literal.