Skip to content

Commit 7f4f04d

Browse files
committed
Expose print_directive function to enable schema sharding
Replicates graphql/graphql-js@d45e48b
1 parent a8cffbf commit 7f4f04d

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

docs/modules/utilities.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ Sort a GraphQLSchema:
4141

4242
Print a GraphQLSchema to GraphQL Schema language:
4343

44-
.. autofunction:: print_introspection_schema
4544
.. autofunction:: print_schema
4645
.. autofunction:: print_type
46+
.. autofunction:: print_directive
47+
.. autofunction:: print_introspection_schema
4748

4849
Create a GraphQLType from a GraphQL language AST:
4950

src/graphql/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
print_schema,
189189
# Print a GraphQLType to GraphQL Schema language.
190190
print_type,
191+
# Print a GraphQLDirective to GraphQL Schema language.
192+
print_directive,
191193
# Prints the built-in introspection schema in the Schema Language format.
192194
print_introspection_schema,
193195
# Create a GraphQLType from a GraphQL language AST.
@@ -788,6 +790,7 @@
788790
"lexicographic_sort_schema",
789791
"print_schema",
790792
"print_type",
793+
"print_directive",
791794
"print_introspection_schema",
792795
"type_from_ast",
793796
"value_from_ast",

src/graphql/utilities/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727

2828
# Print a GraphQLSchema to GraphQL Schema language.
2929
from .print_schema import (
30-
print_introspection_schema,
3130
print_schema,
3231
print_type,
32+
print_directive,
33+
print_introspection_schema,
3334
print_value, # deprecated
3435
)
3536

@@ -103,9 +104,10 @@
103104
"is_type_sub_type_of",
104105
"introspection_from_schema",
105106
"lexicographic_sort_schema",
106-
"print_introspection_schema",
107107
"print_schema",
108108
"print_type",
109+
"print_directive",
110+
"print_introspection_schema",
109111
"print_value",
110112
"separate_operations",
111113
"strip_ignored_characters",

src/graphql/utilities/print_schema.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
)
3333
from .ast_from_value import ast_from_value
3434

35-
__all__ = ["print_schema", "print_introspection_schema", "print_type", "print_value"]
35+
__all__ = [
36+
"print_schema",
37+
"print_type",
38+
"print_directive",
39+
"print_introspection_schema",
40+
"print_value",
41+
]
3642

3743

3844
def print_schema(schema: GraphQLSchema) -> str:

0 commit comments

Comments
 (0)