Skip to content

Commit 4e6cff7

Browse files
committed
scalars array
1 parent 9ff931c commit 4e6cff7

8 files changed

Lines changed: 19 additions & 10 deletions

File tree

examples/typescript-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-node",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"description": "",
55
"private": true,
66
"main": "index.js",

examples/typescript-node/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const sel = Selector('Query')({
6060
Children: true,
6161
Attack: true,
6262
info: true,
63+
ids: true,
6364
attack: [{ cardID: ['sss'] }, { Attack: true }],
6465
},
6566
cardById: [{ cardId: '' }, { Attack: true }],
@@ -99,6 +100,7 @@ const run = async () => {
99100
},
100101
{
101102
info: true,
103+
ids: true,
102104
cardImage: {
103105
bucket: true,
104106
region: true,

examples/typescript-node/src/zeus/const.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ export const ReturnTypes: Record<string,any> = {
6565
info:"JSON",
6666
name:"String",
6767
skills:"SpecialSkills",
68-
testFn:"String"
68+
testFn:"String",
69+
ids:"ID"
6970
},
7071
SpecialCard:{
7172
effect:"String",

examples/typescript-node/src/zeus/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,8 @@ type IsScalar<S, SCLR extends ScalarDefinition> = S extends 'scalar' & { name: i
743743
? ReturnType<SCLR[T]['decode']>
744744
: unknown
745745
: unknown
746-
: S;
746+
: S extends Array<infer R> ? Array<IsScalar<R,SCLR>> : S;
747+
747748
type IsArray<T, U, SCLR extends ScalarDefinition> = T extends Array<infer R>
748749
? InputType<R, U, SCLR>[]
749750
: InputType<T, U, SCLR>;
@@ -967,6 +968,7 @@ attack?: [{ /** Attacked card/card ids<br> */
967968
name?:boolean | `@${string}`,
968969
skills?:boolean | `@${string}`,
969970
testFn?: [{ test?: string | undefined | null | Variable<any, string>},boolean | `@${string}`],
971+
ids?:boolean | `@${string}`,
970972
__typename?: boolean | `@${string}`
971973
}>;
972974
["SpecialCard"]: AliasType<{
@@ -1074,6 +1076,7 @@ attack?: [{ /** Attacked card/card ids<br> */
10741076
name?:boolean | `@${string}`,
10751077
skills?:boolean | `@${string}`,
10761078
testFn?: [{ test?: string | undefined | null},boolean | `@${string}`],
1079+
ids?:boolean | `@${string}`,
10771080
__typename?: boolean | `@${string}`
10781081
}>;
10791082
["SpecialCard"]: AliasType<{
@@ -1178,7 +1181,8 @@ export type ModelTypes = {
11781181
/** The name of a card<br> */
11791182
name: string,
11801183
skills?: Array<ModelTypes["SpecialSkills"]> | undefined | null,
1181-
testFn?: string | undefined | null
1184+
testFn?: string | undefined | null,
1185+
ids?: Array<ModelTypes["ID"]> | undefined | null
11821186
};
11831187
["SpecialCard"]: {
11841188
effect: string,
@@ -1281,7 +1285,8 @@ export type GraphQLTypes = {
12811285
/** The name of a card<br> */
12821286
name: string,
12831287
skills?: Array<GraphQLTypes["SpecialSkills"]> | undefined | null,
1284-
testFn?: string | undefined | null
1288+
testFn?: string | undefined | null,
1289+
ids?: Array<GraphQLTypes["ID"]> | undefined | null
12851290
};
12861291
["SpecialCard"]: {
12871292
__typename: "SpecialCard",

examples/typescript-node/zeus.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ type Card implements Nameable {
8484
name: String!
8585
skills: [SpecialSkills!]
8686
testFn(test: String): String
87+
ids: [ID!]
8788
}
8889

8990
type SpecialCard implements Nameable {

packages/graphql-zeus-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-zeus-core",
3-
"version": "7.0.5",
3+
"version": "7.0.6",
44
"private": false,
55
"main": "./lib/index.js",
66
"author": "GraphQL Editor, Artur Czemiel",

packages/graphql-zeus-jsonschema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-zeus-jsonschema",
3-
"version": "7.0.5",
3+
"version": "7.0.6",
44
"private": false,
55
"main": "./lib/index.js",
66
"author": "GraphQL Editor, Artur Czemiel",

packages/graphql-zeus/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-zeus",
3-
"version": "7.0.5",
3+
"version": "7.0.6",
44
"private": false,
55
"scripts": {
66
"start": "ttsc --watch",
@@ -26,8 +26,8 @@
2626
"dependencies": {
2727
"config-maker": "^0.0.6",
2828
"cross-fetch": "^3.0.4",
29-
"graphql-zeus-core": "^7.0.5",
30-
"graphql-zeus-jsonschema": "^7.0.5",
29+
"graphql-zeus-core": "^7.0.6",
30+
"graphql-zeus-jsonschema": "^7.0.6",
3131
"yargs": "^16.1.1"
3232
}
3333
}

0 commit comments

Comments
 (0)