Task: Changed all queryies, mutations and subscription to resolver
This commit is contained in:
parent
0bb930a128
commit
fbb7937d36
@ -1,4 +1,4 @@
|
||||
package com.cubetiqs.graphql.demo.mutation
|
||||
package com.cubetiqs.graphql.demo.resolver.mutation
|
||||
|
||||
import com.cubetiqs.graphql.demo.context.GMutation
|
||||
import com.cubetiqs.graphql.demo.domain.account.Account
|
||||
@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Propagation
|
||||
import org.springframework.transaction.annotation.Transactional
|
||||
|
||||
@GMutation
|
||||
class AccountMutation @Autowired constructor(
|
||||
class AccountMutationResolver @Autowired constructor(
|
||||
private val accountRepository: AccountRepository,
|
||||
private val userRepository: UserRepository,
|
||||
) : GraphQLMutationResolver {
|
@ -1,4 +1,4 @@
|
||||
package com.cubetiqs.graphql.demo.mutation
|
||||
package com.cubetiqs.graphql.demo.resolver.mutation
|
||||
|
||||
import com.cubetiqs.graphql.demo.context.GMutation
|
||||
import com.cubetiqs.graphql.demo.domain.user.User
|
||||
@ -11,7 +11,7 @@ import org.springframework.transaction.annotation.Propagation
|
||||
import org.springframework.transaction.annotation.Transactional
|
||||
|
||||
@GMutation
|
||||
class UserMutation @Autowired constructor(
|
||||
class UserMutationResolver @Autowired constructor(
|
||||
private val userRepository: UserRepository,
|
||||
) : GraphQLMutationResolver {
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
@ -1,4 +1,4 @@
|
||||
package com.cubetiqs.graphql.demo.query
|
||||
package com.cubetiqs.graphql.demo.resolver.query
|
||||
|
||||
import com.cubetiqs.graphql.demo.context.GQuery
|
||||
import com.cubetiqs.graphql.demo.domain.account.Account
|
||||
@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.data.domain.Pageable
|
||||
|
||||
@GQuery
|
||||
class AccountQuery @Autowired constructor(
|
||||
class AccountQueryResolver @Autowired constructor(
|
||||
private val accountRepository: AccountRepository,
|
||||
) : GraphQLQueryResolver {
|
||||
fun fetchAccounts(): Collection<Account> {
|
@ -1,4 +1,4 @@
|
||||
package com.cubetiqs.graphql.demo.query
|
||||
package com.cubetiqs.graphql.demo.resolver.query
|
||||
|
||||
import com.cubetiqs.graphql.demo.context.GQuery
|
||||
import graphql.kickstart.tools.GraphQLQueryResolver
|
||||
@ -6,7 +6,7 @@ import reactor.core.publisher.Mono
|
||||
import java.util.concurrent.CompletableFuture
|
||||
|
||||
@GQuery
|
||||
class HelloQuery : GraphQLQueryResolver {
|
||||
class HelloQueryResolver : GraphQLQueryResolver {
|
||||
fun hello(): CompletableFuture<String> {
|
||||
return Mono.just("Hello Query...!").toFuture()
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.cubetiqs.graphql.demo.query
|
||||
package com.cubetiqs.graphql.demo.resolver.query
|
||||
|
||||
import com.cubetiqs.graphql.demo.context.GQuery
|
||||
import com.cubetiqs.graphql.demo.domain.user.User
|
||||
@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.data.domain.Pageable
|
||||
|
||||
@GQuery
|
||||
class UserQuery @Autowired constructor(
|
||||
class UserQueryResolver @Autowired constructor(
|
||||
private val userRepository: UserRepository,
|
||||
) : GraphQLQueryResolver {
|
||||
fun fetchUsers(): Collection<User> {
|
@ -1,4 +1,4 @@
|
||||
package com.cubetiqs.graphql.demo.resolver
|
||||
package com.cubetiqs.graphql.demo.resolver.subscription
|
||||
|
||||
import graphql.kickstart.tools.GraphQLSubscriptionResolver
|
||||
import graphql.schema.DataFetchingEnvironment
|
Loading…
Reference in New Issue
Block a user