We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 816f16e commit 005fe36Copy full SHA for 005fe36
src/utilities/__tests__/astFromValue-test.js
@@ -245,4 +245,26 @@ describe('astFromValue', () => {
245
value: { kind: 'EnumValue', value: 'HELLO' } } ] }
246
);
247
});
248
+
249
+ it('converts input objects with explicit nulls', () => {
250
+ const inputObj = new GraphQLInputObjectType({
251
+ name: 'MyInputObj',
252
+ fields: {
253
+ foo: { type: GraphQLFloat },
254
+ bar: { type: myEnum },
255
+ }
256
+ });
257
258
+ expect(astFromValue(
259
+ { foo: null },
260
+ inputObj
261
+ )).to.deep.equal(
262
+ { kind: 'ObjectValue',
263
+ fields: [
264
+ { kind: 'ObjectField',
265
+ name: { kind: 'Name', value: 'foo' },
266
+ value: { kind: 'NullValue' } } ] }
267
+ );
268
269
270
0 commit comments