package Ġcom . example . Movie Review Board . resolver Ċ Ċ import Ġcom . co xa ut ode v . graphql . tools . GraphQL Query Resolver Ċ import Ġcom . example . Movie Review Board . director . Director Ċ import Ġcom . example . Movie Review Board . director . Director Repository Ċ import Ġcom . example . Movie Review Board . movie . Movie Ċ import Ġcom . example . Movie Review Board . movie . Movie Repository Ċ import Ġorg . springframework . stereotype . Component Ċ Ċ @ Component Ċ class ĠQuery ( val Ġmovie Repository : ĠMovie Repository , Ġval Ġdirector Repository : ĠDirect or Repository ): ĠGraphQL Query Resolver Ġ{ ĊĊĠĠĠ Ġfun ĠfindAll Movies (): ĠIterable < Movie > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Repository . findAll () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠfindAll Direct ors (): ĠIterable < Director > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdirector Repository . findAll () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcount Movies (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Repository . count () Ġas ĠInt ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcount Direct ors (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdirector Repository . count () Ġas ĠInt ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġfind Movies By Director ( director Id : ĠInt ): ĠIterable < Movie > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdirector Ġ= Ġdirector Repository . findById ( director Id ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Repository . findBy Director ( director . get ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcount Movies By Director ( director Id : ĠInt ): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdirector Ġ= Ġdirector Repository . findById ( director Id ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġmovie Repository . count By Director ( director . get ()) ĊĠĠĠ Ġ} Ċ }