-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql,#1058): Allow declaration of custom ID scalar type
* Added new IDField decorator to allow specifying a custom ID type to be used for all inputs that require an ID
- Loading branch information
1 parent
2f5b250
commit fb2ed7a
Showing
55 changed files
with
711 additions
and
171 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
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 @@ | ||
export type NamedType = { name: string }; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types | ||
export const isNamed = (SomeType: any): SomeType is NamedType => | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
'name' in SomeType && typeof SomeType.name === 'string'; |
8 changes: 8 additions & 0 deletions
8
packages/query-graphql/__tests__/__fixtures__/delete-one-custom-id-input-type.graphql
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,8 @@ | ||
type Query { | ||
test(input: DeleteOneCustomId!): Int! | ||
} | ||
|
||
input DeleteOneCustomId { | ||
"""The id of the record to delete.""" | ||
id: String! | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/query-graphql/__tests__/__fixtures__/find-one-args-type.graphql
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,6 @@ | ||
type Query { | ||
test( | ||
"""The id of the record to find.""" | ||
id: ID! | ||
): Int! | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/query-graphql/__tests__/__fixtures__/find-one-custom-id-args-type.graphql
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,6 @@ | ||
type Query { | ||
test( | ||
"""The id of the record to find.""" | ||
id: String! | ||
): Int! | ||
} |
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
11 changes: 11 additions & 0 deletions
11
packages/query-graphql/__tests__/__fixtures__/relation-custom-parent-id-input-type.graphql
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,11 @@ | ||
type Query { | ||
test(input: RelationCustomParentIdInput!): Int! | ||
} | ||
|
||
input RelationCustomParentIdInput { | ||
"""The id of the record.""" | ||
id: String! | ||
|
||
"""The id of relation.""" | ||
relationId: ID! | ||
} |
11 changes: 11 additions & 0 deletions
11
...uery-graphql/__tests__/__fixtures__/relation-custom-parent-relation-id-input-type.graphql
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,11 @@ | ||
type Query { | ||
test(input: RelationCustomParentAndRelationIdInput!): Int! | ||
} | ||
|
||
input RelationCustomParentAndRelationIdInput { | ||
"""The id of the record.""" | ||
id: String! | ||
|
||
"""The id of relation.""" | ||
relationId: String! | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/query-graphql/__tests__/__fixtures__/relation-custom-relation-id-input-type.graphql
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,11 @@ | ||
type Query { | ||
test(input: RelationCustomRelationIdInput!): Int! | ||
} | ||
|
||
input RelationCustomRelationIdInput { | ||
"""The id of the record.""" | ||
id: ID! | ||
|
||
"""The id of relation.""" | ||
relationId: String! | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/query-graphql/__tests__/__fixtures__/relations-custom-parent-id-input-type.graphql
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,11 @@ | ||
type Query { | ||
test(input: RelationsCustomParentIdInput!): Int! | ||
} | ||
|
||
input RelationsCustomParentIdInput { | ||
"""The id of the record.""" | ||
id: String! | ||
|
||
"""The ids of the relations.""" | ||
relationIds: [ID!]! | ||
} |
11 changes: 11 additions & 0 deletions
11
...ery-graphql/__tests__/__fixtures__/relations-custom-parent-relation-id-input-type.graphql
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,11 @@ | ||
type Query { | ||
test(input: RelationsCustomParentRelationIdInput!): Int! | ||
} | ||
|
||
input RelationsCustomParentRelationIdInput { | ||
"""The id of the record.""" | ||
id: String! | ||
|
||
"""The ids of the relations.""" | ||
relationIds: [String!]! | ||
} |
11 changes: 11 additions & 0 deletions
11
...ages/query-graphql/__tests__/__fixtures__/relations-custom-relation-id-input-type.graphql
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,11 @@ | ||
type Query { | ||
test(input: RelationsCustomRelationIdInput!): Int! | ||
} | ||
|
||
input RelationsCustomRelationIdInput { | ||
"""The id of the record.""" | ||
id: ID! | ||
|
||
"""The ids of the relations.""" | ||
relationIds: [String!]! | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/query-graphql/__tests__/__fixtures__/update-one-custom-id-input-type.graphql
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,15 @@ | ||
type Query { | ||
updateTest(input: UpdateOneCustomId!): Int! | ||
} | ||
|
||
input UpdateOneCustomId { | ||
"""The id of the record to update""" | ||
id: String! | ||
|
||
"""The update to apply.""" | ||
update: FakeUpdateOneType! | ||
} | ||
|
||
input FakeUpdateOneType { | ||
name: String! | ||
} |
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
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
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
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
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
Oops, something went wrong.