GraphQL Query for Mongodb

302 Views Asked by At

I am using graphql from the last few days. I am using query to excess some data from my mongodb data base. The query is

query {try{sentences{tokens { index word }}}}

It is giving me all the data from my data base. Now when I am trying to use some filter in my query, I am facing error. If any one can me any idea or solution about my mistake it will be helpful.enter image description here

enter image description here

I tried same (word: "such") , in query, try and sentences also. But facing same error. Tried to do greater, equal and different query with find and filter.

***schema

enter image description here

1

There are 1 best solutions below

2
Chandan On

Try after changing query as below:

{
    query {
        try {
            sentences {
                tokens(query: { word: "such"}) {
                    word
                }
            }
        }
    }
}