提供[Object Object]的GraphQl查询

时间:2019-02-11 17:17:51

标签: angular typescript graphql

我正在将名称过滤器数组传递给findAssets()graphQl查询

    let paramsStr = this.getParamString({
      bounds: bounds,
      limit: limit,
      offset: offset,
      filter : filterCriteria ? filterCriteria : ''
    });
    let query = {
      query: `{
                data:findAssets(${paramsStr})
                { list
                  {
                    address {
                      number street zipCode
                    }
                    memberOf {city}
                    info {name value}
                    media {type caption path}
                      }
                  }
              }`
    };
    return this.http.post(environment.graphQLEndPoint, JSON.stringify(query), { headers: this.getHeaders() })
  }

现在,如果我执行Console.log(filterCriteria),我将获得所需的数组

但在查询中,此错误如下:

"{
                data:findAssets(bounds:[[2.3834430425840765,48.88251557009002],[2.310486957374451,48.835250711799574]],filter: [object Object])
                { list
                  {
                    address {
                      number street zipCode
                    }
                    memberOf {city}
                    info {name value}
                    media {type caption path}
                      }
                  }
              }"

0 个答案:

没有答案