Skip to content

Commit 1ae8b71

Browse files
committed
enableNotationWithoutParentheses = true
1 parent a2aebb7 commit 1ae8b71

2 files changed

Lines changed: 48 additions & 28 deletions

File tree

cinema-api/build.gradle.kts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
1+
import io.github.ermadmi78.kobby.kobby
2+
13
description = "Cinema API"
24

5+
buildscript {
6+
dependencies {
7+
classpath("io.github.ermadmi78:kobby-gradle-plugin:5.1.1-SNAPSHOT")
8+
}
9+
}
10+
311
plugins {
412
kotlin("jvm")
5-
id("io.github.ermadmi78.kobby") version "5.0.0"
13+
//id("io.github.ermadmi78.kobby") version "5.0.0"
614
}
715

16+
apply(plugin = "io.github.ermadmi78.kobby")
17+
818
kotlin {
919
jvmToolchain(17)
1020
}
1121

22+
kobby {
23+
kotlin {
24+
entity {
25+
projection {
26+
enableNotationWithoutParentheses = true
27+
}
28+
}
29+
}
30+
}
31+
1232
dependencies {
1333
// Add this dependency to enable Jackson annotation generation in DTO classes
1434
compileOnly("com.fasterxml.jackson.core:jackson-annotations:2.15.4")

cinema-client/src/main/kotlin/io/github/ermadmi78/kobby/cinema/client/application.kt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class Application : CommandLineRunner {
4848
launch(Dispatchers.Default) {
4949
context.subscription {
5050
filmCreated {
51-
id()
52-
title()
51+
id
52+
title
5353
}
5454
}.subscribe {
5555
subscribed.complete()
@@ -73,12 +73,12 @@ class Application : CommandLineRunner {
7373

7474
val result = context.query {
7575
film(id = 0L) {
76-
id()
77-
title()
76+
id
77+
title
7878
actors {
79-
id()
80-
firstName()
81-
lastName()
79+
id
80+
firstName
81+
lastName
8282
}
8383
}
8484
}
@@ -98,8 +98,8 @@ class Application : CommandLineRunner {
9898

9999
val first = context.mutation {
100100
createFilm("First") {
101-
id()
102-
title()
101+
id
102+
title
103103
}
104104
}
105105

@@ -115,8 +115,8 @@ class Application : CommandLineRunner {
115115

116116
val second = context.mutation {
117117
createFilm("Second") {
118-
id()
119-
title()
118+
id
119+
title
120120
}
121121
}
122122

@@ -132,8 +132,8 @@ class Application : CommandLineRunner {
132132

133133
val third = context.mutation {
134134
createFilm("Third") {
135-
id()
136-
title()
135+
id
136+
title
137137
}
138138
}
139139

@@ -149,12 +149,12 @@ class Application : CommandLineRunner {
149149

150150
val allFilms = context.query {
151151
films {
152-
id()
153-
title()
152+
id
153+
title
154154
actors {
155-
id()
156-
firstName()
157-
lastName()
155+
id
156+
firstName
157+
lastName
158158
}
159159
}
160160
}
@@ -174,12 +174,12 @@ class Application : CommandLineRunner {
174174

175175
val (myQuery, myQueryArgs) = buildCinemaQuery {
176176
film(3) {
177-
id()
178-
title()
177+
id
178+
title
179179
actors {
180-
id()
181-
firstName()
182-
lastName()
180+
id
181+
firstName
182+
lastName
183183
}
184184
}
185185
}
@@ -189,8 +189,8 @@ class Application : CommandLineRunner {
189189

190190
val (myMutation, myMutationArgs) = buildCinemaMutation {
191191
createFilm("My film") {
192-
id()
193-
title()
192+
id
193+
title
194194
}
195195
}
196196
println(myMutation)
@@ -199,8 +199,8 @@ class Application : CommandLineRunner {
199199

200200
val (mySubscription, miSubscriptionArgs) = buildCinemaSubscription {
201201
filmCreated {
202-
id()
203-
title()
202+
id
203+
title
204204
}
205205
}
206206
println(mySubscription)

0 commit comments

Comments
 (0)