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.context.GMutation
|
||||||
import com.cubetiqs.graphql.demo.domain.account.Account
|
import com.cubetiqs.graphql.demo.domain.account.Account
|
||||||
@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Propagation
|
|||||||
import org.springframework.transaction.annotation.Transactional
|
import org.springframework.transaction.annotation.Transactional
|
||||||
|
|
||||||
@GMutation
|
@GMutation
|
||||||
class AccountMutation @Autowired constructor(
|
class AccountMutationResolver @Autowired constructor(
|
||||||
private val accountRepository: AccountRepository,
|
private val accountRepository: AccountRepository,
|
||||||
private val userRepository: UserRepository,
|
private val userRepository: UserRepository,
|
||||||
) : GraphQLMutationResolver {
|
) : 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.context.GMutation
|
||||||
import com.cubetiqs.graphql.demo.domain.user.User
|
import com.cubetiqs.graphql.demo.domain.user.User
|
||||||
@ -11,7 +11,7 @@ import org.springframework.transaction.annotation.Propagation
|
|||||||
import org.springframework.transaction.annotation.Transactional
|
import org.springframework.transaction.annotation.Transactional
|
||||||
|
|
||||||
@GMutation
|
@GMutation
|
||||||
class UserMutation @Autowired constructor(
|
class UserMutationResolver @Autowired constructor(
|
||||||
private val userRepository: UserRepository,
|
private val userRepository: UserRepository,
|
||||||
) : GraphQLMutationResolver {
|
) : GraphQLMutationResolver {
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
@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.context.GQuery
|
||||||
import com.cubetiqs.graphql.demo.domain.account.Account
|
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
|
import org.springframework.data.domain.Pageable
|
||||||
|
|
||||||
@GQuery
|
@GQuery
|
||||||
class AccountQuery @Autowired constructor(
|
class AccountQueryResolver @Autowired constructor(
|
||||||
private val accountRepository: AccountRepository,
|
private val accountRepository: AccountRepository,
|
||||||
) : GraphQLQueryResolver {
|
) : GraphQLQueryResolver {
|
||||||
fun fetchAccounts(): Collection<Account> {
|
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 com.cubetiqs.graphql.demo.context.GQuery
|
||||||
import graphql.kickstart.tools.GraphQLQueryResolver
|
import graphql.kickstart.tools.GraphQLQueryResolver
|
||||||
@ -6,7 +6,7 @@ import reactor.core.publisher.Mono
|
|||||||
import java.util.concurrent.CompletableFuture
|
import java.util.concurrent.CompletableFuture
|
||||||
|
|
||||||
@GQuery
|
@GQuery
|
||||||
class HelloQuery : GraphQLQueryResolver {
|
class HelloQueryResolver : GraphQLQueryResolver {
|
||||||
fun hello(): CompletableFuture<String> {
|
fun hello(): CompletableFuture<String> {
|
||||||
return Mono.just("Hello Query...!").toFuture()
|
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.context.GQuery
|
||||||
import com.cubetiqs.graphql.demo.domain.user.User
|
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
|
import org.springframework.data.domain.Pageable
|
||||||
|
|
||||||
@GQuery
|
@GQuery
|
||||||
class UserQuery @Autowired constructor(
|
class UserQueryResolver @Autowired constructor(
|
||||||
private val userRepository: UserRepository,
|
private val userRepository: UserRepository,
|
||||||
) : GraphQLQueryResolver {
|
) : GraphQLQueryResolver {
|
||||||
fun fetchUsers(): Collection<User> {
|
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.kickstart.tools.GraphQLSubscriptionResolver
|
||||||
import graphql.schema.DataFetchingEnvironment
|
import graphql.schema.DataFetchingEnvironment
|
Loading…
Reference in New Issue
Block a user