diff --git a/src/utilities/__tests__/astFromValue-test.ts b/src/utilities/__tests__/astFromValue-test.ts index 0f9d474256..195dfc153f 100644 --- a/src/utilities/__tests__/astFromValue-test.ts +++ b/src/utilities/__tests__/astFromValue-test.ts @@ -233,6 +233,24 @@ describe('astFromValue', () => { expect(() => astFromValue('value', returnCustomClassScalar)).to.throw( 'Cannot convert value to AST: {}.', ); + + const returnObjectScalar = new GraphQLScalarType({ + name: 'ReturnObjectScalar', + serialize() { + return { some: 'data' }; + }, + }); + + expect(astFromValue('value', returnObjectScalar)).to.deep.equal({ + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'some' }, + value: { kind: 'StringValue', value: 'data' }, + }, + ], + }); }); it('does not converts NonNull values to NullValue', () => {