Update schema generation
This commit is contained in:
parent
b7e929e9dd
commit
9a2991961c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -7,9 +7,23 @@ import os
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
filename = 'schema.json'
|
schemas = [
|
||||||
|
{
|
||||||
|
'filename': 'schema.json',
|
||||||
|
'schema': 'api.schema.schema'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'filename': 'schema_public.json',
|
||||||
|
'schema': 'api.schema_public.schema'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
for schema in schemas:
|
||||||
|
self.create_schema(schema['filename'], schema['schema'])
|
||||||
|
|
||||||
|
def create_schema(self, filename, schema):
|
||||||
cypress_path = os.path.join(settings.BASE_DIR, '..', 'client', 'cypress', 'fixtures', filename)
|
cypress_path = os.path.join(settings.BASE_DIR, '..', 'client', 'cypress', 'fixtures', filename)
|
||||||
call_command('graphql_schema', schema='api.schema.schema', out=filename, indent=4)
|
call_command('graphql_schema', schema=schema, out=filename, indent=4)
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
initial_json = json.loads(f.read())
|
initial_json = json.loads(f.read())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue