File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
src/core/edgedb/generator Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export async function generateQueryBuilder({
22
22
schemaDir : 'unused' ,
23
23
} ) ;
24
24
addJsExtensionDeepPathsOfEdgedbLibrary ( qbDir ) ;
25
- changeCustomScalars ( qbDir ) ;
25
+ fixCustomScalarsImports ( qbDir ) ;
26
26
updateEdgeQLRenderingForOurCustomScalars ( qbDir ) ;
27
27
updateCastMapsForOurCustomScalars ( qbDir ) ;
28
28
changeImplicitIDType ( qbDir ) ;
@@ -42,20 +42,11 @@ function addJsExtensionDeepPathsOfEdgedbLibrary(qbDir: Directory) {
42
42
}
43
43
}
44
44
45
- function changeCustomScalars ( qbDir : Directory ) {
46
- // Change $uuid scalar type alias to use ID type instead of string
45
+ function fixCustomScalarsImports ( qbDir : Directory ) {
47
46
for ( const scalars of groupBy ( customScalars . values ( ) , ( s ) => s . module ) ) {
48
47
const moduleFile = qbDir . addSourceFileAtPath (
49
48
`modules/${ scalars [ 0 ] ! . module } .ts` ,
50
49
) ;
51
- for ( const scalar of scalars ) {
52
- const typeAlias = moduleFile . getTypeAliasOrThrow ( `$${ scalar . type } ` ) ;
53
- typeAlias
54
- . getFirstChildByKindOrThrow ( SyntaxKind . TypeReference )
55
- . getFirstChildByKindOrThrow ( SyntaxKind . SyntaxList )
56
- . getLastChildOrThrow ( )
57
- . replaceWithText ( scalar . ts ) ;
58
- }
59
50
addCustomScalarImports ( moduleFile , scalars ) ;
60
51
}
61
52
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export const customScalars = mapEntries(codecs, (codec) => [
8
8
] ) . asMap ;
9
9
10
10
export function setTsTypesFromOurScalarCodecs ( ) {
11
- // this is used for schema interfaces
11
+ // this is used for schema interfaces & query builder
12
12
for ( const { info } of codecs ) {
13
13
const fqName = `${ info . module } ::${ info . type } ` ;
14
14
scalarToLiteralMapping [ fqName ] . type = info . ts ;
You can’t perform that action at this time.
0 commit comments