Skip to content

Commit 7ef4be5

Browse files
committed
More necessary GraphQL schema additions
1 parent 0377069 commit 7ef4be5

21 files changed

Lines changed: 1138 additions & 11 deletions

File tree

spellsource-graphql/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ tasks.named("yarnRunCodegen").configure {
5757
inputs.file("schema.graphql")
5858
inputs.dir("graphql/web")
5959
inputs.dir("graphql/shared")
60+
61+
mustRunAfter ":spellsource-server:generateSchema"
6062
// TODO manually specify outputs as well?
6163
}
6264

@@ -80,6 +82,8 @@ tasks.named("yarnRunStrawberryShake").configure {
8082
into "../spellsource-client/src/unity/Assets/Scripts/"
8183
}
8284
}
85+
86+
mustRunAfter ":spellsource-server:generateSchema"
8387
}
8488

8589
tasks.register("generateAll") {
@@ -103,6 +107,6 @@ tasks.register("generateSchema") {
103107
tasks.register("regenerate") {
104108
group('spellsource')
105109
description("Full cycle: generate stitched schema then run all codegen.")
106-
dependsOn generateSchema, generateAll
107-
generateAll.mustRunAfter(generateSchema)
110+
dependsOn generateSchema
111+
finalizedBy generateAll
108112
}

spellsource-graphql/graphql/shared/fragments/entity.graphql

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,61 @@ fragment entity on Entity {
1111
zone
1212
player
1313
}
14+
art {
15+
body {
16+
vertex {
17+
r
18+
g
19+
b
20+
a
21+
}
22+
}
23+
highlight {
24+
r
25+
g
26+
b
27+
a
28+
}
29+
loop {
30+
named
31+
}
32+
missile {
33+
named
34+
}
35+
onCast {
36+
named
37+
}
38+
onHit {
39+
named
40+
}
41+
primary {
42+
r
43+
g
44+
b
45+
a
46+
}
47+
secondary {
48+
r
49+
g
50+
b
51+
a
52+
}
53+
shadow {
54+
r
55+
g
56+
b
57+
a
58+
}
59+
spell {
60+
named
61+
}
62+
sprite {
63+
named
64+
}
65+
spriteShadow {
66+
named
67+
}
68+
}
1469
owner
1570
boardPosition
1671
attack

spellsource-graphql/graphql/shared/fragments/serverGameMessage.graphql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ fragment serverGameMessage on ServerGameMessage {
3232
...entitySummary
3333
}
3434
value
35+
cardEvent {
36+
card {
37+
...entitySummary
38+
}
39+
showLocal
40+
}
41+
entityTouched
42+
entityUntouched
3543
}
3644
gameOver {
3745
localPlayerWon

spellsource-graphql/graphql/shared/fragments/spellAction.graphql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@ fragment spellAction on SpellAction {
1111
target
1212
friendlyBattlefieldIndex
1313
}
14+
choices {
15+
action
16+
actionType
17+
sourceId
18+
description
19+
entity {
20+
...entitySummary
21+
}
22+
targetKeyToActions {
23+
action
24+
target
25+
friendlyBattlefieldIndex
26+
}
27+
}
1428
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mutation touchEntity($entityId: Int!) {
2+
touchEntity(entityId: $entityId)
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mutation untouchEntity($entityId: Int!) {
2+
untouchEntity(entityId: $entityId)
3+
}

spellsource-graphql/schema.graphql

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,12 @@ type Mutation {
721721
"""Concede the current game."""
722722
concedeGame: Boolean!
723723

724+
"""Notify the opponent that a local entity is being hovered."""
725+
touchEntity(entityId: Int!): Boolean!
726+
727+
"""Notify the opponent that a local entity is no longer being hovered."""
728+
untouchEntity(entityId: Int!): Boolean!
729+
724730
"""cards (editable)"""
725731
putCard(input: PutCardInput!): PutCardResult!
726732
deleteCard(editableCardId: String!): Boolean!
@@ -4007,6 +4013,41 @@ enum ActionType {
40074013
TAP
40084014
}
40094015

4016+
type Art {
4017+
body: ArtFont
4018+
highlight: ArtColor
4019+
loop: ArtPrefab
4020+
missile: ArtPrefab
4021+
onCast: ArtPrefab
4022+
onHit: ArtPrefab
4023+
primary: ArtColor
4024+
secondary: ArtColor
4025+
shadow: ArtColor
4026+
spell: ArtPrefab
4027+
sprite: ArtSprite
4028+
spriteShadow: ArtSprite
4029+
}
4030+
4031+
"""─── Art types ────────────────────────────────────────────────"""
4032+
type ArtColor {
4033+
r: Float!
4034+
g: Float!
4035+
b: Float!
4036+
a: Float!
4037+
}
4038+
4039+
type ArtFont {
4040+
vertex: ArtColor
4041+
}
4042+
4043+
type ArtPrefab {
4044+
named: String
4045+
}
4046+
4047+
type ArtSprite {
4048+
named: String
4049+
}
4050+
40104051
input AttributeValueInput {
40114052
attribute: PlayerEntityAttribute!
40124053
stringValue: String!
@@ -4018,6 +4059,11 @@ type AttributeValueTuple {
40184059
stringValue: String!
40194060
}
40204061

4062+
type CardEvent {
4063+
card: Entity
4064+
showLocal: Boolean!
4065+
}
4066+
40214067
"""─── Card catalogue ───────────────────────────────────────────"""
40224068
type CardRecord {
40234069
id: BigInt!
@@ -4154,6 +4200,7 @@ type Entity {
41544200
entityType: EntityType!
41554201
rarity: Rarity!
41564202
location: EntityLocation
4203+
art: Art
41574204
owner: Int!
41584205
boardPosition: Int!
41594206

@@ -4268,6 +4315,9 @@ type GameEvent {
42684315
target: Entity
42694316
targets: [Entity!]!
42704317
value: Int
4318+
cardEvent: CardEvent
4319+
entityTouched: Int
4320+
entityUntouched: Int
42714321
}
42724322

42734323
enum GameEventType {

spellsource-server/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,5 +449,6 @@ tasks.register("generateSchema", JavaExec) {
449449
mainClass.set('com.hiddenswitch.framework.tests.applications.SchemaGeneratorEntryPoint')
450450
environment("TESTCONTAINERS_REUSE_ENABLE", "true")
451451
jvmArgs.addAll(jvmArgs)
452+
inputs.file("src/main/resources/schema.graphqls")
452453
outputs.file(rootProject.file("spellsource-graphql/schema.graphql"))
453454
}

0 commit comments

Comments
 (0)