Skip to content

Commit ca7d537

Browse files
authored
fix: Prevent generation of Child Doc cursors (#62)
* feat: added flag to prevent generation of Child Doc curors/pagination support * fix: remove `include_default_childdoctype_queries` option from `generate_sdl`
1 parent e5e4507 commit ca7d537

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

frappe_graphql/commands/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def graphql():
2121
help="Ignore custom fields generation")
2222
@click.option("--disable-enum-select-fields", is_flag=True, default=False,
2323
help="Disable generating GQLEnums for Frappe Select DocFields")
24+
2425
@pass_context
2526
def generate_sdl(
2627
context, output_dir=None, app=None, module=None, doctype=None,

frappe_graphql/utils/generate_sdl/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@
4141
]
4242

4343

44-
def make_doctype_sdl_files(target_dir, app=None, modules=[], doctypes=[],
45-
ignore_custom_fields=False, disable_enum_select_fields=False):
44+
def make_doctype_sdl_files(
45+
target_dir,
46+
app=None,
47+
modules=[],
48+
doctypes=[],
49+
ignore_custom_fields=False,
50+
disable_enum_select_fields=False
51+
):
4652
specific_doctypes = doctypes or []
4753
doctypes = get_doctypes(
4854
app=app,

frappe_graphql/utils/generate_sdl/doctype.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ def get_doctype_sdl(doctype, options):
2626
if not options.disable_enum_select_fields:
2727
sdl += get_select_docfield_enums(meta=meta, options=options, generated_enums=generated_enums)
2828

29-
# DocTypeSortingInput
30-
if not meta.issingle:
31-
sdl += get_sorting_input(meta)
32-
sdl += get_connection_type(meta)
29+
if not meta.istable:
3330

34-
# Extend QueryType
35-
sdl += get_query_type_extension(meta)
31+
# DocTypeSortingInput
32+
if not meta.issingle:
33+
sdl += get_sorting_input(meta)
34+
sdl += get_connection_type(meta)
35+
36+
# Extend QueryType
37+
sdl += get_query_type_extension(meta)
3638

3739
return sdl
3840

0 commit comments

Comments
 (0)