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 998de88 commit 1bc9066Copy full SHA for 1bc9066
tests/valibot.spec.ts
@@ -181,4 +181,37 @@ describe('valibot', () => {
181
"
182
`);
183
})
184
+ it('with scalars', async () => {
185
+ const schema = buildSchema(/* GraphQL */ `
186
+ input Say {
187
+ phrase: Text!
188
+ times: Count!
189
+ }
190
+ scalar Count
191
+ scalar Text
192
+ `);
193
+ const result = await plugin(
194
+ schema,
195
+ [],
196
+ {
197
+ schema: 'valibot',
198
+ scalars: {
199
+ Text: 'string',
200
+ Count: 'number',
201
+ },
202
203
+ {},
204
+ );
205
+ expect(result.content).toMatchInlineSnapshot(`
206
+ "
207
+
208
+ export function SaySchema(): v.GenericSchema<Say> {
209
+ return v.object({
210
+ phrase: v.string(),
211
+ times: v.number()
212
+ })
213
214
215
216
+ });
217
0 commit comments