Skip to content

Commit afe1867

Browse files
YOUR_NAMEYOUR_NAME
authored andcommitted
subs
1 parent 148851a commit afe1867

File tree

10 files changed

+1798
-22
lines changed

10 files changed

+1798
-22
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"urlOrPath": "zeus.old.graphql"
3+
}

examples/typescript-node/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-node",
3-
"version": "3.1.7",
3+
"version": "3.1.8",
44
"description": "",
55
"private": true,
66
"main": "index.js",
@@ -9,6 +9,7 @@
99
"just-run": "node --loader ts-node/esm src/index.ts",
1010
"start": "npm run generate-typescript-node && node --import=tsx src/index.ts",
1111
"generate-typescript-node-config": "node ../../packages/graphql-zeus/lib/index.js --n -g ./zeus.graphql --td",
12+
"generate-typescript-node-config-old": "node ../../packages/graphql-zeus/lib/index.js ./zeus.old.graphql ./src/old",
1213
"generate-typescript-node": "node ../../packages/graphql-zeus/lib/index.js http://localhost:4003/graphql ./src --n -g ./zeus.graphql --td",
1314
"generate-typescript-node-get": "node ../../packages/graphql-zeus/lib/index.js http://localhost:4003/graphql ./src --n -g ./zeus.graphql --method=GET --td"
1415
},
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
interface Nameable {
2+
name: String!
3+
}
4+
5+
enum SpecialSkills {
6+
"""Lower enemy defense -5<br>"""
7+
THUNDER
8+
9+
"""Attack multiple Cards at once<br>"""
10+
RAIN
11+
12+
"""50% chance to avoid any attack<br>"""
13+
FIRE
14+
}
15+
16+
type Query {
17+
cardById(cardId: String): Card
18+
19+
"""Draw a card<br>"""
20+
drawCard: Card!
21+
drawChangeCard: ChangeCard!
22+
23+
"""list All Cards availble<br>"""
24+
listCards: [Card!]!
25+
myStacks: [CardStack!]
26+
nameables: [Nameable!]!
27+
public: Public
28+
}
29+
30+
"""create card inputs<br>"""
31+
input createCard {
32+
"""The name of a card<br>"""
33+
name: String!
34+
35+
"""Description of a card<br>"""
36+
description: String!
37+
38+
"""<div>How many children the greek god had</div>"""
39+
Children: Int
40+
41+
"""The attack power<br>"""
42+
Attack: Int!
43+
44+
"""The defense power<br>"""
45+
Defense: Int!
46+
47+
"""input skills"""
48+
skills: [SpecialSkills!]
49+
}
50+
51+
"""Stack of cards"""
52+
type CardStack implements Nameable {
53+
cards: [Card!]
54+
name: String!
55+
}
56+
57+
"""Card used in card game<br>"""
58+
type Card implements Nameable {
59+
"""The attack power<br>"""
60+
Attack: Int!
61+
62+
"""<div>How many children the greek god had</div>"""
63+
Children: Int
64+
65+
"""The defense power<br>"""
66+
Defense: Int!
67+
68+
"""Attack other cards on the table , returns Cards after attack<br>"""
69+
attack(
70+
"""Attacked card/card ids<br>"""
71+
cardID: [String!]!
72+
): [Card!]
73+
74+
"""Put your description here"""
75+
cardImage: S3Object
76+
77+
"""Description of a card<br>"""
78+
description: String!
79+
id: ID!
80+
image: String!
81+
info: JSON!
82+
83+
"""The name of a card<br>"""
84+
name: String!
85+
skills: [SpecialSkills!]
86+
testFn(test: String): String
87+
}
88+
89+
type SpecialCard implements Nameable {
90+
effect: String!
91+
name: String!
92+
}
93+
94+
type EffectCard implements Nameable {
95+
effectSize: Float!
96+
name: String!
97+
}
98+
99+
type Mutation {
100+
"""add Card to Cards database<br>"""
101+
addCard(card: createCard!): Card!
102+
}
103+
104+
scalar JSON
105+
106+
"""Aws S3 File"""
107+
type S3Object {
108+
bucket: String!
109+
key: String!
110+
region: String!
111+
}
112+
113+
type Public {
114+
powerups(filter: String!): [Powerup!]
115+
}
116+
117+
type Powerup {
118+
name: String
119+
}
120+
121+
union ChangeCard = SpecialCard | EffectCard
122+
123+
type Subscription {
124+
deck: [Card!]
125+
}
126+
schema{
127+
query: Query,
128+
mutation: Mutation,
129+
subscription: Subscription
130+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/* eslint-disable */
2+
3+
export const AllTypesProps: Record<string,any> = {
4+
SpecialSkills: "enum" as const,
5+
Query:{
6+
cardById:{
7+
8+
}
9+
},
10+
createCard:{
11+
skills:"SpecialSkills"
12+
},
13+
Card:{
14+
attack:{
15+
16+
},
17+
testFn:{
18+
19+
}
20+
},
21+
Mutation:{
22+
addCard:{
23+
card:"createCard"
24+
}
25+
},
26+
JSON: `scalar.JSON` as const,
27+
Public:{
28+
powerups:{
29+
30+
}
31+
},
32+
ID: `scalar.ID` as const
33+
}
34+
35+
export const ReturnTypes: Record<string,any> = {
36+
Nameable:{
37+
"...on CardStack": "CardStack",
38+
"...on Card": "Card",
39+
"...on SpecialCard": "SpecialCard",
40+
"...on EffectCard": "EffectCard",
41+
name:"String"
42+
},
43+
Query:{
44+
cardById:"Card",
45+
drawCard:"Card",
46+
drawChangeCard:"ChangeCard",
47+
listCards:"Card",
48+
myStacks:"CardStack",
49+
nameables:"Nameable",
50+
public:"Public"
51+
},
52+
CardStack:{
53+
cards:"Card",
54+
name:"String"
55+
},
56+
Card:{
57+
Attack:"Int",
58+
Children:"Int",
59+
Defense:"Int",
60+
attack:"Card",
61+
cardImage:"S3Object",
62+
description:"String",
63+
id:"ID",
64+
image:"String",
65+
info:"JSON",
66+
name:"String",
67+
skills:"SpecialSkills",
68+
testFn:"String"
69+
},
70+
SpecialCard:{
71+
effect:"String",
72+
name:"String"
73+
},
74+
EffectCard:{
75+
effectSize:"Float",
76+
name:"String"
77+
},
78+
Mutation:{
79+
addCard:"Card"
80+
},
81+
JSON: `scalar.JSON` as const,
82+
S3Object:{
83+
bucket:"String",
84+
key:"String",
85+
region:"String"
86+
},
87+
Public:{
88+
powerups:"Powerup"
89+
},
90+
Powerup:{
91+
name:"String"
92+
},
93+
ChangeCard:{
94+
"...on SpecialCard":"SpecialCard",
95+
"...on EffectCard":"EffectCard"
96+
},
97+
Subscription:{
98+
deck:"Card"
99+
},
100+
ID: `scalar.ID` as const
101+
}
102+
103+
export const Ops = {
104+
query: "Query" as const,
105+
mutation: "Mutation" as const,
106+
subscription: "Subscription" as const
107+
}

0 commit comments

Comments
 (0)