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 48d64fa commit 02eb6f2Copy full SHA for 02eb6f2
tests/valibot.spec.ts
@@ -147,4 +147,39 @@ describe('valibot', () => {
147
"
148
`);
149
})
150
+
151
+ it('with scalars', async () => {
152
+ const schema = buildSchema(/* GraphQL */ `
153
+ input Say {
154
+ phrase: Text!
155
+ times: Count!
156
+ }
157
158
+ scalar Count
159
+ scalar Text
160
+ `);
161
+ const result = await plugin(
162
+ schema,
163
+ [],
164
+ {
165
+ schema: 'valibot',
166
+ scalars: {
167
+ Text: 'string',
168
+ Count: 'number',
169
+ },
170
171
+ {},
172
+ );
173
+ expect(result.content).toMatchInlineSnapshot(`
174
+ "
175
176
+ export function SaySchema() {
177
+ return v.object({
178
+ phrase: v.string(),
179
+ times: v.number()
180
+ })
181
182
183
184
+ });
185
0 commit comments