-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve perf by avoid running
preEmitDiagnostics
per file (#344)
- Loading branch information
Showing
28 changed files
with
1,165 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@eddeee888/gcg-typescript-resolver-files': patch | ||
--- | ||
|
||
Update internals to use faster approach to run static analysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
...ript-resolver-files-e2e/src/test-mappers-vs-schema-types/modules/topic/resolvers/Topic.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
import type { TopicResolvers } from './../../types.generated'; | ||
export const Topic: TopicResolvers = { | ||
/* Implement Topic resolver logic here */ | ||
id: ({ id }) => id, | ||
createdAt: async (_parent, _arg, _ctx) => { | ||
/* existing implementation, must keep */ | ||
return '2024-01-01T00:00:00.000Z'; | ||
}, | ||
creator: ({ creator }, _arg, _ctx) => { | ||
/* Topic.creator resolver is required because Topic.creator and TopicMapper.creator are not compatible */ | ||
return creator; | ||
}, | ||
name: async (_parent, _arg, _ctx) => { | ||
/* Topic.name resolver is required because Topic.name exists but TopicMapper.name does not */ | ||
}, | ||
url: async (_parent, _arg, _ctx) => { | ||
/* Topic.url resolver is required because Topic.url exists but TopicMapper.url does not */ | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...script-resolver-files-e2e/src/test-mappers-vs-schema-types/modules/topic/topic.mappers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { UserMapper } from '../user/user.graphqls.mappers'; | ||
|
||
export type TopicMapper = { | ||
id: string; | ||
creator: string; | ||
mostRelatedTopic?: TopicMapper; | ||
relatedTopics: TopicMapper[]; | ||
likedBy: UserMapper[]; | ||
likedByNullable: null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/typescript-resolver-files-e2e/src/test-mappers-vs-schema-types/testSetup.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { createTestSetup } = require('../utils/createTestSetup'); | ||
|
||
createTestSetup({ | ||
baseDir: | ||
'packages/typescript-resolver-files-e2e/src/test-mappers-vs-schema-types/', | ||
files: [ | ||
{ | ||
file: 'modules/topic/resolvers/Topic.ts', | ||
content: `import type { TopicResolvers } from './../../types.generated'; | ||
export const Topic: TopicResolvers = { | ||
id: ({ id }) => id, | ||
createdAt: async (_parent, _arg, _ctx) => { | ||
/* existing implementation, must keep */ | ||
return '2024-01-01T00:00:00.000Z'; | ||
}, | ||
};`, | ||
}, | ||
], | ||
}); |
Oops, something went wrong.