|
| 1 | +/* eslint-disable max-lines */ |
1 | 2 | import ts from 'typescript'; |
2 | 3 | import { buildSymmetricScalarSpec, ScalarSpec } from './mapping.js'; |
3 | 4 | import { invokeMethod } from '../../../../shared.js'; |
@@ -52,16 +53,45 @@ export const additionalScalarsMapping = { |
52 | 53 | [] |
53 | 54 | ) |
54 | 55 | ), |
55 | | - Url: buildSymmetricScalarSpec( |
56 | | - ts.factory.createCallExpression( |
| 56 | + Url: { |
| 57 | + inputSchema: invokeMethod( |
| 58 | + ts.factory.createCallExpression( |
| 59 | + ts.factory.createPropertyAccessExpression( |
| 60 | + ts.factory.createIdentifier('z'), |
| 61 | + 'custom' |
| 62 | + ), |
| 63 | + [ts.factory.createTypeReferenceNode('URL')], |
| 64 | + [] |
| 65 | + ), |
| 66 | + 'transform', |
| 67 | + [ts.factory.createArrowFunction( |
| 68 | + undefined, |
| 69 | + undefined, |
| 70 | + [ts.factory.createParameterDeclaration( |
| 71 | + undefined, |
| 72 | + undefined, |
| 73 | + 'url' |
| 74 | + )], |
| 75 | + undefined, |
| 76 | + ts.factory.createToken( |
| 77 | + ts.SyntaxKind.EqualsGreaterThanToken |
| 78 | + ), |
| 79 | + invokeMethod( |
| 80 | + ts.factory.createIdentifier('url'), |
| 81 | + 'toString', |
| 82 | + [] |
| 83 | + ) |
| 84 | + )] |
| 85 | + ), |
| 86 | + outputSchema: ts.factory.createCallExpression( |
57 | 87 | ts.factory.createPropertyAccessExpression( |
58 | 88 | ts.factory.createIdentifier('z'), |
59 | 89 | 'custom' |
60 | 90 | ), |
61 | 91 | [ts.factory.createTypeReferenceNode('URL')], |
62 | 92 | [] |
63 | | - ) |
64 | | - ), |
| 93 | + ), |
| 94 | + }, |
65 | 95 | Void: buildSymmetricScalarSpec( |
66 | 96 | ts.factory.createCallExpression( |
67 | 97 | ts.factory.createPropertyAccessExpression( |
|
0 commit comments