@@ -1000,6 +1000,10 @@ describe('Introspection', () => {
1000
1000
type : GraphQLString ,
1001
1001
deprecationReason : 'Removed in 1.0' ,
1002
1002
} ,
1003
+ deprecatedWithEmptyReason : {
1004
+ type : GraphQLString ,
1005
+ deprecationReason : '' ,
1006
+ } ,
1003
1007
} ,
1004
1008
} ) ;
1005
1009
@@ -1032,6 +1036,11 @@ describe('Introspection', () => {
1032
1036
isDeprecated : true ,
1033
1037
deprecationReason : 'Removed in 1.0' ,
1034
1038
} ,
1039
+ {
1040
+ name : 'deprecatedWithEmptyReason' ,
1041
+ isDeprecated : true ,
1042
+ deprecationReason : '' ,
1043
+ } ,
1035
1044
] ,
1036
1045
} ,
1037
1046
} ,
@@ -1160,9 +1169,10 @@ describe('Introspection', () => {
1160
1169
const TestEnum = new GraphQLEnumType ( {
1161
1170
name : 'TestEnum' ,
1162
1171
values : {
1163
- NON_DEPRECATED : { value : 0 } ,
1164
- DEPRECATED : { value : 1 , deprecationReason : 'Removed in 1.0' } ,
1165
- ALSO_NON_DEPRECATED : { value : 2 } ,
1172
+ NON_DEPRECATED : { } ,
1173
+ DEPRECATED : { deprecationReason : 'Removed in 1.0' } ,
1174
+ DEPRECATED_WITH_EMPTY_REASON : { deprecationReason : '' } ,
1175
+ ALSO_NON_DEPRECATED : { } ,
1166
1176
} ,
1167
1177
} ) ;
1168
1178
@@ -1179,7 +1189,6 @@ describe('Introspection', () => {
1179
1189
const source = `
1180
1190
{
1181
1191
__type(name: "TestEnum") {
1182
- name
1183
1192
trueValues: enumValues(includeDeprecated: true) {
1184
1193
name
1185
1194
}
@@ -1196,33 +1205,19 @@ describe('Introspection', () => {
1196
1205
expect ( graphqlSync ( { schema, source } ) ) . to . deep . equal ( {
1197
1206
data : {
1198
1207
__type : {
1199
- name : 'TestEnum' ,
1200
1208
trueValues : [
1201
- {
1202
- name : 'NON_DEPRECATED' ,
1203
- } ,
1204
- {
1205
- name : 'DEPRECATED' ,
1206
- } ,
1207
- {
1208
- name : 'ALSO_NON_DEPRECATED' ,
1209
- } ,
1209
+ { name : 'NON_DEPRECATED' } ,
1210
+ { name : 'DEPRECATED' } ,
1211
+ { name : 'DEPRECATED_WITH_EMPTY_REASON' } ,
1212
+ { name : 'ALSO_NON_DEPRECATED' } ,
1210
1213
] ,
1211
1214
falseValues : [
1212
- {
1213
- name : 'NON_DEPRECATED' ,
1214
- } ,
1215
- {
1216
- name : 'ALSO_NON_DEPRECATED' ,
1217
- } ,
1215
+ { name : 'NON_DEPRECATED' } ,
1216
+ { name : 'ALSO_NON_DEPRECATED' } ,
1218
1217
] ,
1219
1218
omittedValues : [
1220
- {
1221
- name : 'NON_DEPRECATED' ,
1222
- } ,
1223
- {
1224
- name : 'ALSO_NON_DEPRECATED' ,
1225
- } ,
1219
+ { name : 'NON_DEPRECATED' } ,
1220
+ { name : 'ALSO_NON_DEPRECATED' } ,
1226
1221
] ,
1227
1222
} ,
1228
1223
} ,
0 commit comments