0
{
    indexName: String,
    documentName: String,               
    'queryString': {
        "query": {
            "bool": {
                "should": [{
                    "bool": {
                        "must": [{
                            "match_phrase": {
                                "from.jid": String
                            }
                        },
                        {
                            "match_phrase": {
                                "to.jid": String
                            }
                        }],
                        "must_not": {
                            "exists": {"field": "isDeleted"}
                        }
                    }
                },
                {
                    "bool": {
                        "must": [{
                            "match_phrase": {
                                "from.jid": String
                            }
                        },
                        {
                            "match_phrase": {
                                "to.jid": String
                            }
                        }],
                        "must_not": {
                            "exists": {"field": "isDeleted"}
                        }
                    }
                }],
                "minimum_should_match": 1
            }
        },
        "scroll": "1m",
        "scroll_id": scrollId ? scrollId : '',
        //"from": length,
        "size": 10,
        "sort": [{
            "createdOn":"desc"
        }],

    }
}
Sanjay Verma
  • 397
  • 3
  • 3
  • a custom scalar is probably the easiest. graphql-type-json will accomplish this. if you need the input strongly typed you can either modify that scalar to do a type validation or go through the process of creating several graphql input types and composing them. – vbranden Dec 21 '17 at 14:19
  • Have you tried using input objects (`GraphQLInputObjectType` from _graphql-js_)? – Herku Dec 23 '17 at 13:33
  • Thanks for the replies... I am bit new to node and graphQL. So i don't know how to use. I am just writing type in module.exports in particular file and merging all type file in index.js using merge-graphql-schemas. Can you please tell me step by step, that will be a huge help – Sanjay Verma Dec 26 '17 at 06:43

0 Answers0