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 d811c97 commit 495f5b5Copy full SHA for 495f5b5
src/utilities/__tests__/astFromValue-test.ts
@@ -233,6 +233,24 @@ describe('astFromValue', () => {
233
expect(() => astFromValue('value', returnCustomClassScalar)).to.throw(
234
'Cannot convert value to AST: {}.',
235
);
236
+
237
+ const returnObjectScalar = new GraphQLScalarType({
238
+ name: 'ReturnObjectScalar',
239
+ serialize() {
240
+ return { some: 'data' };
241
+ },
242
+ });
243
244
+ expect(astFromValue('value', returnObjectScalar)).to.deep.equal({
245
+ kind: 'ObjectValue',
246
+ fields: [
247
+ {
248
+ kind: 'ObjectField',
249
+ name: { kind: 'Name', value: 'some' },
250
+ value: { kind: 'StringValue', value: 'data' },
251
252
+ ],
253
254
});
255
256
it('does not converts NonNull values to NullValue', () => {
0 commit comments