How to use the gql.renderer_dataclasses.DataclassesRenderer function in gql

To help you get started, we’ve selected a few gql 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 graphql-python / gql-next / gql / cli.py View on Github external
def __init__(self, config: Config, schema: GraphQLSchema):
            self.parser = QueryParser(schema)
            self.renderer = DataclassesRenderer(schema, config)
github graphql-python / gql-next / gql / codec / transform.py View on Github external
def get_renderer() -> DataclassesRenderer:
    if 'RENDERER' not in globals():
        schema = get_schema()
        config = get_config()
        globals()['RENDERER'] = DataclassesRenderer(schema, config, internal_ns=True)

    return globals()['RENDERER']
github graphql-python / gql-next / gql / cli.py View on Github external
def run(config_filename):
    if not isfile(config_filename):
        click.echo(f'Could not find configuration file {config_filename}')

    config = Config.load(config_filename)
    schema = load_schema(config.schema)

    filenames = glob.glob(config.documents, recursive=True)

    query_parser = QueryParser(schema)
    query_renderer = DataclassesRenderer(schema, config)

    for filename in filenames:
        process_file(filename, query_parser, query_renderer)