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
interface Profile { | |
val id: UUID, | |
val name: String | |
} | |
data class User { | |
override val id: UUID, | |
override val name: String | |
}: Profile |
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
interface Profile { | |
id: ID | |
name: String | |
} | |
type User implements Profile { | |
id: ID | |
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
type User { | |
id: ID | |
name: String | |
} | |
type Company { | |
id: ID | |
name: String | |
address: 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
@Component | |
class VehicleResolver(private val vehicleService: VehicleService) : GraphQLQueryResolver { | |
fun getIVehicles(): List<IVehicle> { | |
return vehicleService.getIVehicles() | |
} | |
} | |
@Service | |
class VehicleService { | |
fun getIVehicles(): List<IVehicle> { | |
return listOf( |
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
interface IVehicle { | |
val name: String | |
} | |
data class IBike(override val name: String, val price: Int): IVehicle | |
data class ICar(override val name: String, val price: Int, val engineType: String) : IVehicle |
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
type Query{ | |
hello: String | |
getIVehicles: [IVehicle]! | |
} | |
interface IVehicle{ | |
name: String | |
price: 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
implementation("com.graphql-java-kickstart:graphql-spring-boot-starter:6.0.1") | |
implementation("com.graphql-java-kickstart:graphql-java-tools:5.7.1") | |
runtimeOnly("com.graphql-java-kickstart:altair-spring-boot-starter:6.0.1") | |
runtimeOnly("com.graphql-java-kickstart:graphiql-spring-boot-starter:6.0.1") | |
runtimeOnly("com.graphql-java-kickstart:voyager-spring-boot-starter:6.0.1") | |
runtimeOnly("com.graphql-java-kickstart:playground-spring-boot-starter:6.0.1") |
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
type Query{ | |
hello: 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
@Component | |
class HelloWorldResolver: GraphQLQueryResolver { | |
fun hello(): String { | |
return "Hello World!" | |
} | |
} |
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
query{ | |
hello | |
} |
OlderNewer