-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pagination limit/offset in Query
- Track/Check graphql schema changes - Check migration changes - Refactor pagination components - Upgrade packages - Major upgrade for strawberry - Minor upgrade for other packages
- Loading branch information
Showing
11 changed files
with
752 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
django/apps/existing_database/management/commands/graphql_schema.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import argparse | ||
|
||
from django.core.management.base import BaseCommand | ||
from mapswipe.graphql import schema | ||
from strawberry.printer import print_schema | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Create schema.graphql file" | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument( | ||
"--out", | ||
type=argparse.FileType("w"), | ||
default="schema.graphql", | ||
) | ||
|
||
def handle(self, *args, **options): | ||
file = options["out"] | ||
file.write(print_schema(schema)) | ||
file.close() | ||
self.stdout.write(self.style.SUCCESS(f"{file.name} file generated")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.