Skip to content

Commit 202804c

Browse files
authored
Merge pull request #1 from graphql/master
sync
2 parents c93d7da + f529809 commit 202804c

12 files changed

+182
-103
lines changed

Diff for: .eslintrc.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rules:
3535
# https://github.com/prettier/eslint-plugin-prettier#installation
3636
prettier/prettier: error
3737

38-
# `eslint-plugin-flowtype` rule list based on `v3.0.0`
38+
# `eslint-plugin-flowtype` rule list based on `v3.1.0`
3939
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
4040

4141
flowtype/array-style-complex-type: [error, verbose]
@@ -54,6 +54,7 @@ rules:
5454
#flowtype/no-unused-expressions: undecided
5555
flowtype/no-weak-types: [error, { any: false, mixed: false }]
5656
flowtype/object-type-delimiter: off
57+
#flowtype/require-compound-type-alias: undecided
5758
flowtype/require-exact-type: off
5859
flowtype/require-parameter-type: off
5960
flowtype/require-return-type: off
@@ -72,7 +73,7 @@ rules:
7273
flowtype/valid-syntax: off
7374

7475
##################################################
75-
# ESLint builtin rules list based on `v5.7.0`
76+
# ESLint builtin rules list based on `v5.8.0`
7677
##################################################
7778

7879
# Possible Errors

Diff for: .flowconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)?)\\)
1313
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)?)\\)?:? #[0-9]+
1414

1515
[version]
16-
^0.83.0
16+
^0.84.0

Diff for: package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
"benchmark": "2.1.4",
6767
"chai": "4.2.0",
6868
"coveralls": "3.0.2",
69-
"eslint": "5.7.0",
70-
"eslint-plugin-flowtype": "3.0.0",
69+
"eslint": "5.8.0",
70+
"eslint-plugin-flowtype": "3.1.4",
7171
"eslint-plugin-prettier": "3.0.0",
72-
"flow-bin": "0.83.0",
72+
"flow-bin": "0.84.0",
7373
"mocha": "5.2.0",
7474
"nyc": "13.1.0",
7575
"prettier": "1.14.3",

Diff for: src/language/__tests__/kitchen-sink.graphql

+12-8
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# This source code is licensed under the MIT license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
query queryName($foo: ComplexType, $site: Site = MOBILE) {
6+
query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery {
77
whoever123is: node(id: [123, 456]) {
88
id ,
9-
... on User @defer {
9+
... on User @onInlineFragment {
1010
field2 {
1111
id ,
1212
alias: field1(first:10, after:$foo,) @include(if: $foo) {
1313
id,
14-
...frag
14+
...frag @onFragmentSpread
1515
}
1616
}
1717
}
@@ -24,15 +24,17 @@ query queryName($foo: ComplexType, $site: Site = MOBILE) {
2424
}
2525
}
2626

27-
mutation likeStory {
28-
like(story: 123) @defer {
27+
mutation likeStory @onMutation {
28+
like(story: 123) @onField {
2929
story {
30-
id
30+
id @onField
3131
}
3232
}
3333
}
3434

35-
subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) {
35+
subscription StoryLikeSubscription(
36+
$input: StoryLikeSubscribeInput
37+
) @onSubscription {
3638
storyLikeSubscribe(input: $input) {
3739
story {
3840
likers {
@@ -45,7 +47,7 @@ subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) {
4547
}
4648
}
4749

48-
fragment frag on Friend {
50+
fragment frag on Friend @onFragmentDefinition {
4951
foo(size: $size, bar: $b, obj: {key: "value", block: """
5052
5153
block string uses \"""
@@ -57,3 +59,5 @@ fragment frag on Friend {
5759
unnamed(truthy: true, falsey: false, nullish: null),
5860
query
5961
}
62+
63+
query { __typename }

Diff for: src/language/__tests__/printer-test.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,15 @@ describe('Printer: Query document', () => {
174174

175175
expect(printed).to.equal(
176176
dedent(String.raw`
177-
query queryName($foo: ComplexType, $site: Site = MOBILE) {
177+
query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery {
178178
whoever123is: node(id: [123, 456]) {
179179
id
180-
... on User @defer {
180+
... on User @onInlineFragment {
181181
field2 {
182182
id
183183
alias: field1(first: 10, after: $foo) @include(if: $foo) {
184184
id
185-
...frag
185+
...frag @onFragmentSpread
186186
}
187187
}
188188
}
@@ -195,15 +195,15 @@ describe('Printer: Query document', () => {
195195
}
196196
}
197197
198-
mutation likeStory {
199-
like(story: 123) @defer {
198+
mutation likeStory @onMutation {
199+
like(story: 123) @onField {
200200
story {
201-
id
201+
id @onField
202202
}
203203
}
204204
}
205205
206-
subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) {
206+
subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) @onSubscription {
207207
storyLikeSubscribe(input: $input) {
208208
story {
209209
likers {
@@ -216,7 +216,7 @@ describe('Printer: Query document', () => {
216216
}
217217
}
218218
219-
fragment frag on Friend {
219+
fragment frag on Friend @onFragmentDefinition {
220220
foo(size: $size, bar: $b, obj: {key: "value", block: """
221221
block string uses \"""
222222
"""})
@@ -226,6 +226,10 @@ describe('Printer: Query document', () => {
226226
unnamed(truthy: true, falsey: false, nullish: null)
227227
query
228228
}
229+
230+
{
231+
__typename
232+
}
229233
`),
230234
);
231235
});

Diff for: src/language/__tests__/schema-kitchen-sink.graphql

+24-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This is a description
1313
of the `Foo` type.
1414
"""
1515
type Foo implements Bar & Baz {
16+
"Description of the `one` field."
1617
one: Type
1718
"""
1819
This is a description of the `two` field.
@@ -23,6 +24,7 @@ type Foo implements Bar & Baz {
2324
"""
2425
argument: InputType!
2526
): Type
27+
"""This is a description of the `three` field."""
2628
three(argument: InputType, other: String): Int
2729
four(argument: String = "string"): String
2830
five(argument: [String] = ["string", "string"]): String
@@ -31,7 +33,7 @@ type Foo implements Bar & Baz {
3133
}
3234

3335
type AnnotatedObject @onObject(arg: "value") {
34-
annotatedField(arg: Type = "default" @onArg): Type @onField
36+
annotatedField(arg: Type = "default" @onArgumentDefinition): Type @onField
3537
}
3638

3739
type UndefinedType
@@ -48,7 +50,7 @@ interface Bar {
4850
}
4951

5052
interface AnnotatedInterface @onInterface {
51-
annotatedField(arg: Type @onArg): Type @onField
53+
annotatedField(arg: Type @onArgumentDefinition): Type @onField
5254
}
5355

5456
interface UndefinedInterface
@@ -59,7 +61,10 @@ extend interface Bar {
5961

6062
extend interface Bar @onInterface
6163

62-
union Feed = Story | Article | Advert
64+
union Feed =
65+
| Story
66+
| Article
67+
| Advert
6368

6469
union AnnotatedUnion @onUnion = A | B
6570

@@ -78,8 +83,16 @@ scalar AnnotatedScalar @onScalar
7883
extend scalar CustomScalar @onScalar
7984

8085
enum Site {
86+
"""
87+
This is a description of the `DESKTOP` value
88+
"""
8189
DESKTOP
90+
91+
"""This is a description of the `MOBILE` value"""
8292
MOBILE
93+
94+
"This is a description of the `WEB` value"
95+
WEB
8396
}
8497

8598
enum AnnotatedEnum @onEnum {
@@ -101,18 +114,23 @@ input InputType {
101114
}
102115

103116
input AnnotatedInput @onInputObject {
104-
annotatedField: Type @onField
117+
annotatedField: Type @onInputFieldDefinition
105118
}
106119

107120
input UndefinedInput
108121

109122
extend input InputType {
110-
other: Float = 1.23e4
123+
other: Float = 1.23e4 @onInputFieldDefinition
111124
}
112125

113126
extend input InputType @onInputObject
114127

115-
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
128+
"""
129+
This is a description of the `@skip` directive
130+
"""
131+
directive @skip(
132+
if: Boolean! @onArgumentDefinition
133+
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
116134

117135
directive @include(if: Boolean!)
118136
on FIELD

Diff for: src/language/__tests__/schema-printer-test.js

+20-5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe('Printer: SDL document', () => {
5959
of the \`Foo\` type.
6060
"""
6161
type Foo implements Bar & Baz {
62+
"Description of the \`one\` field."
6263
one: Type
6364
"""
6465
This is a description of the \`two\` field.
@@ -69,6 +70,9 @@ describe('Printer: SDL document', () => {
6970
"""
7071
argument: InputType!
7172
): Type
73+
"""
74+
This is a description of the \`three\` field.
75+
"""
7276
three(argument: InputType, other: String): Int
7377
four(argument: String = "string"): String
7478
five(argument: [String] = ["string", "string"]): String
@@ -77,7 +81,7 @@ describe('Printer: SDL document', () => {
7781
}
7882
7983
type AnnotatedObject @onObject(arg: "value") {
80-
annotatedField(arg: Type = "default" @onArg): Type @onField
84+
annotatedField(arg: Type = "default" @onArgumentDefinition): Type @onField
8185
}
8286
8387
type UndefinedType
@@ -94,7 +98,7 @@ describe('Printer: SDL document', () => {
9498
}
9599
96100
interface AnnotatedInterface @onInterface {
97-
annotatedField(arg: Type @onArg): Type @onField
101+
annotatedField(arg: Type @onArgumentDefinition): Type @onField
98102
}
99103
100104
interface UndefinedInterface
@@ -124,8 +128,16 @@ describe('Printer: SDL document', () => {
124128
extend scalar CustomScalar @onScalar
125129
126130
enum Site {
131+
"""
132+
This is a description of the \`DESKTOP\` value
133+
"""
127134
DESKTOP
135+
"""
136+
This is a description of the \`MOBILE\` value
137+
"""
128138
MOBILE
139+
"This is a description of the \`WEB\` value"
140+
WEB
129141
}
130142
131143
enum AnnotatedEnum @onEnum {
@@ -147,18 +159,21 @@ describe('Printer: SDL document', () => {
147159
}
148160
149161
input AnnotatedInput @onInputObject {
150-
annotatedField: Type @onField
162+
annotatedField: Type @onInputFieldDefinition
151163
}
152164
153165
input UndefinedInput
154166
155167
extend input InputType {
156-
other: Float = 1.23e4
168+
other: Float = 1.23e4 @onInputFieldDefinition
157169
}
158170
159171
extend input InputType @onInputObject
160172
161-
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
173+
"""
174+
This is a description of the \`@skip\` directive
175+
"""
176+
directive @skip(if: Boolean! @onArgumentDefinition) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
162177
163178
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
164179

0 commit comments

Comments
 (0)