Skip to main content
Solved

FDM - Querying using multiple filters

  • November 25, 2022
  • 3 replies
  • 140 views

Hello All,

I am trying to query the FDM schema after populating (listForecast in slb-pdf project). But i am getting the error! seems like an bug. Can you check if I am doing something wrong.

query MyQuery {
  listForecast(filter: {oilRate: {eq: 1.5}, and: {gasRate: {eq: 1.5}}}) {
    edges {
      node {
        id
      }
    }
  }
}

 

Error I am getting is as below. Can you help if known bug or if I should do differently?
 "message": "Expected either 'and', 'or', 'not' or a single field condition used in the same filter block.",

Best answer by Vu Hai Nguyen

Hi,

Your query syntax is not correct. I think if you want the and condition on both oil Rate and gasRate it should be:
filter: { and: [{oilRate: {eq: 1.5}}, {gasRate:{eq:1.5}}]}

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img
  • Practitioner
  • 21 replies
  • Answer
  • November 25, 2022

Hi,

Your query syntax is not correct. I think if you want the and condition on both oil Rate and gasRate it should be:
filter: { and: [{oilRate: {eq: 1.5}}, {gasRate:{eq:1.5}}]}


Thanks Vu Hai Nguyen, I was using the UI to built the query but did not worked somehow.
Thanks for your input, it works!


David Liu
Seasoned Practitioner
  • Seasoned Practitioner
  • 15 replies
  • November 25, 2022

We are working on making the filter builder to be more robust to capture this ability to build “list” of `and` and `or` filters :) Hope the workaround in code will work in the mean time!


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings