Skip to content

Commit 313d66e

Browse files
committed
Add test for building client schema with default value on custom scalar
1 parent 831598b commit 313d66e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/utilities/__tests__/buildClientSchema-test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,30 @@ describe('Type System: build schema from introspection', () => {
343343
await testSchema(schema);
344344
});
345345

346+
it('builds a schema with default value on custom scalar field', async () => {
347+
const schema = new GraphQLSchema({
348+
query: new GraphQLObjectType({
349+
name: 'ArgFields',
350+
fields: {
351+
testField: {
352+
type: GraphQLString,
353+
args: {
354+
testArg: {
355+
type: new GraphQLScalarType({
356+
name: 'CustomScalar',
357+
serialize: value => value
358+
}),
359+
defaultValue: 'default'
360+
}
361+
}
362+
}
363+
}
364+
})
365+
});
366+
367+
await testSchema(schema);
368+
});
369+
346370
it('builds a schema with an enum', async () => {
347371
const foodEnum = new GraphQLEnumType({
348372
name: 'Food',

0 commit comments

Comments
 (0)