-
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.
Ensure object types across multiple schemas have
__isTypeOf
in `Pic…
…k` values (#319) * Make sure __isTypeOf is in the picked properties * Update e2e tests * Add changeset
- Loading branch information
Showing
25 changed files
with
62 additions
and
43 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 | ||
--- | ||
|
||
Ensure \_\_isTypeOf is in the picked properties so users can choose this way to handle abstract type should they choose |
13 changes: 7 additions & 6 deletions
13
...est-extended-object-types/schema-base/book-store-v2_new_again-final_v3/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,7 +1,8 @@ | ||
import type { TopicResolvers } from './../../types.generated'; | ||
export const Topic: Pick<TopicResolvers, 'bookStore_for_topic'> = { | ||
/* Implement Topic resolver logic here */ | ||
bookStore_for_topic: async (_parent, _arg, _ctx) => { | ||
/* Topic.bookStore_for_topic resolver is required because Topic.bookStore_for_topic exists but TopicMapper.bookStore_for_topic does not */ | ||
}, | ||
}; | ||
export const Topic: Pick<TopicResolvers, 'bookStore_for_topic' | '__isTypeOf'> = | ||
{ | ||
/* Implement Topic resolver logic here */ | ||
bookStore_for_topic: async (_parent, _arg, _ctx) => { | ||
/* Topic.bookStore_for_topic resolver is required because Topic.bookStore_for_topic exists but TopicMapper.bookStore_for_topic does not */ | ||
}, | ||
}; |
2 changes: 1 addition & 1 deletion
2
...test-extended-object-types/schema-base/book-store-v2_new_again-final_v3/resolvers/User.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,4 @@ | ||
import type { UserResolvers } from './../../types.generated'; | ||
export const User: Pick<UserResolvers, 'bookStore_4_user'> = { | ||
export const User: Pick<UserResolvers, 'bookStore_4_user' | '__isTypeOf'> = { | ||
/* Implement User resolver logic here */ | ||
}; |
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
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
2 changes: 1 addition & 1 deletion
2
...xtended-object-types/schema-federated-extended-object-type/topic/resolvers/ForeignType.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,7 +1,7 @@ | ||
import type { ForeignTypeResolvers } from './../../types.generated'; | ||
export const ForeignType: Pick< | ||
ForeignTypeResolvers, | ||
'id' | 'topics' | '__resolveReference' | ||
'id' | 'topics' | '__isTypeOf' | '__resolveReference' | ||
> = { | ||
/* Implement ForeignType resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...extended-object-types/schema-federated-extended-object-type/user/resolvers/ForeignType.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,7 +1,7 @@ | ||
import type { ForeignTypeResolvers } from './../../types.generated'; | ||
export const ForeignType: Pick< | ||
ForeignTypeResolvers, | ||
'users' | '__resolveReference' | ||
'users' | '__isTypeOf' | '__resolveReference' | ||
> = { | ||
/* Implement ForeignType resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...solver-files-e2e/src/test-nested-domain-modules/schools-domain/course/resolvers/School.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,4 @@ | ||
import type { SchoolResolvers } from './../../../types.generated'; | ||
export const School: Pick<SchoolResolvers, 'courses'> = { | ||
export const School: Pick<SchoolResolvers, 'courses' | '__isTypeOf'> = { | ||
/* Implement School resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...-files-e2e/src/test-nested-domain-modules/schools-domain/demographics/resolvers/School.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,4 @@ | ||
import type { SchoolResolvers } from './../../../types.generated'; | ||
export const School: Pick<SchoolResolvers, 'demographics'> = { | ||
export const School: Pick<SchoolResolvers, 'demographics' | '__isTypeOf'> = { | ||
/* Implement School resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...solver-files-e2e/src/test-nested-domain-modules/schools-domain/school/resolvers/School.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,4 @@ | ||
import type { SchoolResolvers } from './../../../types.generated'; | ||
export const School: Pick<SchoolResolvers, 'id' | 'name'> = { | ||
export const School: Pick<SchoolResolvers, 'id' | 'name' | '__isTypeOf'> = { | ||
/* Implement School resolver logic here */ | ||
}; |
5 changes: 4 additions & 1 deletion
5
...les-e2e/src/test-nested-domain-modules/students-domain/avatar/resolvers/StudentProfile.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,7 @@ | ||
import type { StudentProfileResolvers } from './../../../types.generated'; | ||
export const StudentProfile: Pick<StudentProfileResolvers, 'avatar'> = { | ||
export const StudentProfile: Pick< | ||
StudentProfileResolvers, | ||
'avatar' | '__isTypeOf' | ||
> = { | ||
/* Implement StudentProfile resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...r-files-e2e/src/test-nested-domain-modules/students-domain/guardians/resolvers/Student.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,4 @@ | ||
import type { StudentResolvers } from './../../../types.generated'; | ||
export const Student: Pick<StudentResolvers, 'guardians'> = { | ||
export const Student: Pick<StudentResolvers, 'guardians' | '__isTypeOf'> = { | ||
/* Implement Student resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...ver-files-e2e/src/test-nested-domain-modules/students-domain/profile/resolvers/Student.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,4 @@ | ||
import type { StudentResolvers } from './../../../types.generated'; | ||
export const Student: Pick<StudentResolvers, 'profile'> = { | ||
export const Student: Pick<StudentResolvers, 'profile' | '__isTypeOf'> = { | ||
/* Implement Student resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...es-e2e/src/test-nested-domain-modules/students-domain/profile/resolvers/StudentProfile.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,7 +1,7 @@ | ||
import type { StudentProfileResolvers } from './../../../types.generated'; | ||
export const StudentProfile: Pick< | ||
StudentProfileResolvers, | ||
'email' | 'firstName' | 'id' | 'lastName' | 'phoneNumber' | ||
'email' | 'firstName' | 'id' | 'lastName' | 'phoneNumber' | '__isTypeOf' | ||
> = { | ||
/* Implement StudentProfile resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...ver-files-e2e/src/test-nested-domain-modules/students-domain/student/resolvers/Student.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,4 @@ | ||
import type { StudentResolvers } from './../../../types.generated'; | ||
export const Student: Pick<StudentResolvers, 'id'> = { | ||
export const Student: Pick<StudentResolvers, 'id' | '__isTypeOf'> = { | ||
/* Implement Student resolver logic here */ | ||
}; |
5 changes: 4 additions & 1 deletion
5
...les-e2e/src/test-nested-domain-modules/teachers-domain/avatar/resolvers/TeacherProfile.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,7 @@ | ||
import type { TeacherProfileResolvers } from './../../../types.generated'; | ||
export const TeacherProfile: Pick<TeacherProfileResolvers, 'avatar'> = { | ||
export const TeacherProfile: Pick< | ||
TeacherProfileResolvers, | ||
'avatar' | '__isTypeOf' | ||
> = { | ||
/* Implement TeacherProfile resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...ver-files-e2e/src/test-nested-domain-modules/teachers-domain/profile/resolvers/Teacher.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,4 @@ | ||
import type { TeacherResolvers } from './../../../types.generated'; | ||
export const Teacher: Pick<TeacherResolvers, 'profile'> = { | ||
export const Teacher: Pick<TeacherResolvers, 'profile' | '__isTypeOf'> = { | ||
/* Implement Teacher resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...es-e2e/src/test-nested-domain-modules/teachers-domain/profile/resolvers/TeacherProfile.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,7 +1,7 @@ | ||
import type { TeacherProfileResolvers } from './../../../types.generated'; | ||
export const TeacherProfile: Pick< | ||
TeacherProfileResolvers, | ||
'email' | 'firstName' | 'id' | 'lastName' | 'phoneNumber' | ||
'email' | 'firstName' | 'id' | 'lastName' | 'phoneNumber' | '__isTypeOf' | ||
> = { | ||
/* Implement TeacherProfile resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...ver-files-e2e/src/test-nested-domain-modules/teachers-domain/teacher/resolvers/Teacher.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,4 @@ | ||
import type { TeacherResolvers } from './../../../types.generated'; | ||
export const Teacher: Pick<TeacherResolvers, 'id'> = { | ||
export const Teacher: Pick<TeacherResolvers, 'id' | '__isTypeOf'> = { | ||
/* Implement Teacher resolver logic here */ | ||
}; |
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
2 changes: 1 addition & 1 deletion
2
...typescript-resolver-files-e2e/src/test-resolvers-auto-wireup/schema/pet/resolvers/User.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,4 @@ | ||
import type { UserResolvers } from './../../types.generated'; | ||
export const User: Pick<UserResolvers, 'pets'> = { | ||
export const User: Pick<UserResolvers, 'pets' | '__isTypeOf'> = { | ||
/* Implement User resolver logic here */ | ||
}; |
2 changes: 1 addition & 1 deletion
2
...escript-resolver-files-e2e/src/test-resolvers-auto-wireup/schema/zoo/resolvers/Profile.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,4 @@ | ||
import type { ProfileResolvers } from './../../types.generated'; | ||
export const Profile: Pick<ProfileResolvers, 'zoo'> = { | ||
export const Profile: Pick<ProfileResolvers, 'zoo' | '__isTypeOf'> = { | ||
/* Implement Profile resolver logic here */ | ||
}; |
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