Example #1
0
 def resolve_rules(self, info, intentid, offset=None, limit=None):
     return [Rule(**r) for r  in StoreProxy.store().Rule.findByParent(parentid=intentid)]
Example #2
0
 def resolve_variables(self, info, entityid, offset=None, limit=None):
     return [Variable(**v) for v in StoreProxy.store().Variable.findByParent(parentid=entityid)]
Example #3
0
 def resolve_intent(self, *args, **kwargs):
     return Intent(**StoreProxy.store().Intent.findById(id=kwargs["id"]))
Example #4
0
 def resolve_entity(self, *args, **kwargs):
     return Entity(**StoreProxy.store().Entity.findById(id=kwargs["id"]))
Example #5
0
        return [Variable(**v) for v in StoreProxy.store().Variable.findByParent(parentid=entityid)]

    def resolve_rules(self, info, intentid, offset=None, limit=None):
        return [Rule(**r) for r  in StoreProxy.store().Rule.findByParent(parentid=intentid)]

    def resolve_rule(self, *args, **kwargs):
        return Rule(**Query.store().Rule.findById(id=kwargs["id"]))

    def resolve_bots(self, info, offset=0, size=10):
        return [Bot(**b) for b in Query.store().Bot.list(offset=offset, size=size)]


if __name__ == "__main__":
    from server.databot.model.models import Models

    StoreProxy.store(Models)
    schema = graphene.Schema(query=Query)
    r = schema.execute("""
            {
            rules(intentid:"qnxarmz") {
                    parent,
                    id,
                    name,
                    description,
                    replacements
            }
            
        }
    """)
    print r.errors
    print r.data
Example #6
0
 def resolve_bot(self):
     return Bot(**StoreProxy.store().Bot.findById(id=self.parent))