需要在graphql中定义输入类型。如果我们像树一样有10个对象,那么我们如何制作呢?

时间:2017-12-21 10:51:23

标签: graphql express-graphql

{
    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"
        }],

    }
}

0 个答案:

没有答案