Hi, it's me with API queries again Below is my que...
# troubleshoot
e
Hi, it's me with API queries again Below is my query, and it gives me this erros:
"Validation error (WrongType@[searchAcrossEntities]) : argument 'input.orFilters[0]' with value 'ObjectValue{objectFields=[ObjectField{name='query', value=StringValue{value='*'}}, ObjectField{name='orFilters', value=ArrayValue{values=[ObjectValue{objectFields=[ObjectField{name='field', value=StringValue{value='removed'}}, ObjectField{name='condition', value=StringValue{value='EQUAL'}}, ObjectField{name='values', value=ArrayValue{values=[StringValue{value='true'}]}}, ObjectField{name='negated', value=BooleanValue{value=false}}]}]}}]}' contains a field not in 'AndFilterInput': 'field'"
But the field
field
is definitely is possible in AndFilterInput. What is wrong here?
Copy code
{
  searchAcrossEntities (
  input: {query: "*",
    orFilters: [{field: "removed", condition: "EQUAL", values: ["true"], negated: false}]}
    )     {
    start
    count
    total
    searchResults {
      entity {
        type
        ... on Dataset {
          urn
          type
          description
          platform {
            name
          }
          name
        }
      }
    }
  }
}
📖 1
🔍 1
✅ 1
l
Hey there 👋 I'm The DataHub Community Support bot. I'm here to help make sure the community can best support you with your request. Let's double check a few things first: ✅ There's a lot of good information on our docs site: www.datahubproject.io/docs, Have you searched there for a solution? ✅ It's not uncommon that someone has run into your exact problem before in the community. Have you searched Slack for similar issues? Did you find a solution to your issue? ❌ Sorry you weren't able to find a solution. I'm sending you some tips on info you can provide to help the community troubleshoot. Whenever you feel your issue is solved, please react ✅ to your original message to let us know!
a
Have you tried adding
AndFilterInput
as well to see if that functions?
e
@astonishing-answer-96712 I'm not sure what you mean. According to docs https://datahubproject.io/docs/graphql/inputObjects#andfilterinput
AndFilterInput
arguments include
field
,
value
negated
and
condition
, which I have in my query. Could you please give and example of piece of syntax you want me to add in the query?
a
It looks like it’s related either too the or filters containing a field that’s unexpected or the AndFilters containing a field that’s unexpected- i’d step through adding the fields one by one to see what the problem field may be
e
I still don't understand which fields you are suggesting to add one by one, sorry🤔 . Could you list them?
a
@bulky-soccer-26729 could you provide some insight here? I feel like it could be a filtering bug- @elegant-salesmen-99143 are you on the most recent version?
b
ah yup i see what's going on here - it's a very easy thing to miss but the input is missing something. you need an extra
and
object inside of the
orFilters
list like this:
Copy code
input: {
    query: "*",
    orFilters: [{and: [{field: "removed", condition: EQUAL, values: ["true"], negated: false}]}]
  }
e
Ah it works now, thank you!
b
nice!