Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, config: Config, schema: GraphQLSchema):
self.parser = QueryParser(schema)
self.renderer = DataclassesRenderer(schema, config)
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']
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)