File tree 3 files changed +17
-9
lines changed
Tests/Functional/app/config
3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,11 @@ protected function outputFieldsSelection($name)
161
161
$ fieldBuilderName = $ field ['builder ' ];
162
162
unset($ field ['builder ' ]);
163
163
} elseif (is_string ($ field )) {
164
+ @trigger_error (
165
+ 'The builder short syntax (Field: Builder => Field: {builder: Builder}) is deprecated as of 0.7 and will be removed in 0.8. ' .
166
+ 'It will be replaced by the field type short syntax (Field: Type => Field: {type: Type}) ' ,
167
+ E_USER_DEPRECATED
168
+ );
164
169
$ fieldBuilderName = $ field ;
165
170
}
166
171
@@ -188,6 +193,15 @@ protected function outputFieldsSelection($name)
188
193
->info ('Array of possible type arguments. Each entry is expected to be an array with following keys: name (string), type ' )
189
194
->useAttributeAsKey ('name ' , false )
190
195
->prototype ('array ' )
196
+ // Allow arg type short syntax (Arg: Type => Arg: {type: Type})
197
+ ->beforeNormalization ()
198
+ ->ifTrue (function ($ options ) {
199
+ return is_string ($ options );
200
+ })
201
+ ->then (function ($ options ) {
202
+ return ['type ' => $ options ];
203
+ })
204
+ ->end ()
191
205
->children ()
192
206
->append ($ this ->typeSelection (true ))
193
207
->append ($ this ->descriptionSection ())
Original file line number Diff line number Diff line change 10
10
config :
11
11
fields :
12
12
dateTime :
13
- type : " DateTime!"
13
+ type : DateTime!
14
14
args :
15
- dateTime :
16
- type : " DateTime"
15
+ dateTime : DateTime
17
16
resolve : ["Overblog\\GraphQLGenerator\\Tests\\Resolver", "getDateTime"]
Original file line number Diff line number Diff line change 20
20
type : object
21
21
config :
22
22
fields :
23
- id :
24
- builder : " Relay::GlobalId"
25
- builderConfig :
26
- typeName : User
23
+ id : " Relay::GlobalId"
27
24
name :
28
25
type : String
29
26
interfaces : [NodeInterface]
47
44
fields :
48
45
id :
49
46
builder : " Relay::GlobalId"
50
- builderConfig :
51
- typeName : Post
52
47
text :
53
48
type : String
54
49
status :
You can’t perform that action at this time.
0 commit comments