How to use the inql.generators.query.generate function in inql

To help you get started, we’ve selected a few inql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github doyensec / graph-ql / inql / introspection.py View on Github external
else:
            # Parse the local JSON file
            with open(args.schema_json_file, "r") as s:
                result_raw = s.read()
                argument = json.loads(result_raw)

        if args.generate_schema:
            schema.generate(argument,
                            fpath=os.path.join(host, "schema-%s-%s.json" % (today, timestamp)))
        if args.generate_html:
            html.generate(argument,
                          fpath=os.path.join(host, "doc-%s-%s.html" % (today, timestamp)),
                          custom=custom,
                          target=args.target)
        if args.generate_queries:
            query.generate(argument,
                           qpath=os.path.join(host, "%s", today, timestamp, "%s"),
                           detect=args.detect,
                           custom=custom,
                           green_print=lambda s: print(string_join(green, "Writing Queries Templates", reset)))

    else:
        # Likely missing a required arguments
        print("Missing Arguments")
        if print_help:
            print(white)
            print_help()
            print(reset)
            exit(1)