Skip to content

Commit 51a791d

Browse files
committed
build_ast_schema: test building of empty types
Replicates graphql/graphql-js@9cf372f
1 parent 09f9c8d commit 51a791d

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a query language for APIs created by Facebook.
1313
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
1414

1515
The current version 1.0.2 of GraphQL-core-next is up-to-date with GraphQL.js version
16-
14.1.1. All parts of the API are covered by an extensive test suite of currently 1726
16+
14.1.1. All parts of the API are covered by an extensive test suite of currently 1731
1717
unit tests.
1818

1919

tests/utilities/test_build_ast_schema.py

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ def add(self, _info, x, y):
7474
None,
7575
)
7676

77+
def empty_type():
78+
sdl = dedent(
79+
"""
80+
type EmptyType
81+
"""
82+
)
83+
assert cycle_sdl(sdl) == sdl
84+
7785
def simple_type():
7886
sdl = dedent(
7987
"""
@@ -266,6 +274,14 @@ def simple_type_with_multiple_arguments():
266274
)
267275
assert cycle_sdl(sdl) == sdl
268276

277+
def empty_interface():
278+
sdl = dedent(
279+
"""
280+
interface EmptyInterface
281+
"""
282+
)
283+
assert cycle_sdl(sdl) == sdl
284+
269285
def simple_type_with_interface():
270286
sdl = dedent(
271287
"""
@@ -280,6 +296,14 @@ def simple_type_with_interface():
280296
)
281297
assert cycle_sdl(sdl) == sdl
282298

299+
def empty_enum():
300+
sdl = dedent(
301+
"""
302+
enum EmptyEnum
303+
"""
304+
)
305+
assert cycle_sdl(sdl) == sdl
306+
283307
def simple_output_enum():
284308
sdl = dedent(
285309
"""
@@ -323,6 +347,14 @@ def multiple_value_enum():
323347
)
324348
assert cycle_sdl(sdl) == sdl
325349

350+
def empty_union():
351+
sdl = dedent(
352+
"""
353+
union EmptyUnion
354+
"""
355+
)
356+
assert cycle_sdl(sdl) == sdl
357+
326358
def simple_union():
327359
sdl = dedent(
328360
"""
@@ -522,7 +554,15 @@ def custom_scalar():
522554
)
523555
assert cycle_sdl(sdl) == sdl
524556

525-
def input_object():
557+
def empty_input_object():
558+
sdl = dedent(
559+
"""
560+
input EmptyInputObject
561+
"""
562+
)
563+
assert cycle_sdl(sdl) == sdl
564+
565+
def simple_input_object():
526566
sdl = dedent(
527567
"""
528568
input Input {

0 commit comments

Comments
 (0)