Skip to content

Commit 0122cc5

Browse files
committed
WIP: Smalle fixes to make kitchen-sink example work
1 parent 1831c80 commit 0122cc5

File tree

6 files changed

+12
-16
lines changed

6 files changed

+12
-16
lines changed

src/schema/format.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl Displayable for Document {
4040

4141
impl Displayable for Definition {
4242
fn display(&self, f: &mut Formatter) {
43+
f.margin();
4344
match *self {
4445
Definition::SchemaDefinition(ref s) => s.display(f),
4546
Definition::TypeDefinition(ref t) => t.display(f),
@@ -283,8 +284,9 @@ impl Displayable for EnumType {
283284
f.endline();
284285
}
285286
f.end_block();
287+
} else {
288+
f.endline();
286289
}
287-
f.endline();
288290
}
289291
}
290292

tests/schema_roundtrips.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,4 @@ fn roundtrip2(filename: &str) {
4747
#[test] fn input_type() { roundtrip("input_type"); }
4848
#[test] fn extend_input() { roundtrip2("extend_input"); }
4949
#[test] fn directive() { roundtrip("directive"); }
50-
// Not yet fully supported
51-
// #[test] fn kitchen_sink() { roundtrip2("kitchen-sink"); }
50+
#[test] fn kitchen_sink() { roundtrip2("kitchen-sink"); }

tests/schemas/enum.graphql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ enum Site {
22
DESKTOP
33
MOBILE
44
}
5-

tests/schemas/implements.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
type Type1 implements IOne
2+
23
type Type1 implements IOne & ITwo
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
type Type1 implements IOne & ITwo
2+
23
type Type2 implements IOne

tests/schemas/kitchen-sink_canonical.graphql

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ schema {
44
}
55

66
"""
7-
This is a description
8-
of the `Foo` type.
7+
This is a description
8+
of the `Foo` type.
99
"""
1010
type Foo implements Bar & Baz {
1111
one: Type
@@ -50,7 +50,7 @@ union Feed = Story | Article | Advert
5050

5151
union AnnotatedUnion @onUnion = A | B
5252

53-
union AnnotatedUnionTwo @onUnion = | A | B
53+
union AnnotatedUnionTwo @onUnion = A | B
5454

5555
union UndefinedUnion
5656

@@ -94,19 +94,13 @@ input AnnotatedInput @onInputObject {
9494
input UndefinedInput
9595

9696
extend input InputType {
97-
other: Float = 1.23e4
97+
other: Float = 12300
9898
}
9999

100100
extend input InputType @onInputObject
101101

102102
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
103103

104-
directive @include(if: Boolean!)
105-
on FIELD
106-
| FRAGMENT_SPREAD
107-
| INLINE_FRAGMENT
104+
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
108105

109-
directive @include2(if: Boolean!) on
110-
| FIELD
111-
| FRAGMENT_SPREAD
112-
| INLINE_FRAGMENT
106+
directive @include2(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

0 commit comments

Comments
 (0)