Hi, I am trying to integrate the GraphQL project into my solution. I am getting my following error. can you please help me out?
It is failing to resolve the RoleQuery. I commented out other query for simplicity for the debugging.
Castle.MicroKernel.Handlers.HandlerException
HResult=0x80131500
Message=Can't create component '...Queries.Container.QueryContainer_f5789103-84f9-497e-b945-fe2b3aaf5af9' as it has dependencies to be satisfied.
'..Queries.Container.QueryContainer_f5789103-84f9-497e-b945-fe2b3aaf5af9' is waiting for the following dependencies:
- Service '..Queries.RoleQuery' which was not registered.
Source=Castle.Windsor
StackTrace:
at Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency()
at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments)
at Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional)
at GraphQL.FuncDependencyResolver.Resolve[T]()
at BizTech.CorsanPortal.Schemas.MainSchema..ctor(IDependencyResolver resolver) in D:\Projects\repos\new4172019\CorsanPortal\aspnet-core\BizTech.CorsanPortal.GraphQL\Schemas\MainSchema.cs:line 13
Thanks, BtsDev
14 Answer(s)
-
0
Have you seen Zero's code? You can compare and see if you missed the code.
https://github.com/aspnetzero/aspnet-zero-core/tree/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.GraphQL
-
0
Hi, can you try resolving
QueryContainer
instead ofRoleQuery
in theMainSchema
?You should follow similar project structure and initialization code as ANZ Graphql project so that if there is any bugfix or enhancement, you can patch it easily
-
0
Did you create an AbpModule in your new GraphQL project? like this https://github.com/aspnetzero/aspnet-zero-core/blob/819e792338a9bf4ae49df4327a2c4e5609cdfd87/aspnet-core/src/MyCompanyName.AbpZeroTemplate.GraphQL/Startup/AbpZeroTemplateGraphQLModule.cs
-
0
@maliming, the link you have posted deosnt exists. can you please re-post the corect link pls?
@ryancyq, I am resolving QueryContainer in MainSchema. Below is constructor of MainSchema class: public MainSchema(IDependencyResolver resolver) : base(resolver) { Query = resolver.Resolve<QueryContainer>(); }
@alpher, I have created MyProjectGraphQLModule in the GrapQL project, which inherts the AbpModule. Btw, then link you have posted doesnt exists. can you please re-post the correct link pls?
-
0
-
0
@maliming, thank you for the response. I can access the link now. Will feedback after comparing the code.
-
0
@maliming, I have compared the code with Zero's code: MyCompanyName.AbpZeroTemplate.GraphQL. all the files are identical except companyname in the namespace. Any idea what might be wrong?
Also, It fails on this below line in MainSchema.cs Query = resolver.Resolve<QueryContainer>();
Appreciate your help!!
-
0
@alper, I have created AbpZeroTemplateGraphQLModule as exactly as specified. Please let me know if there is anything tha I needed to check on.
-
0
Hi BTSDEV
If you download a Zero demo project, will there still be an error?
If the demo project has no errors, it means that your code and Zero still have different places.
You can download and try it out.
-
0
Hi Mailming, Thank you for your prompt reply. I downloaded the demo project. it works. no errors. When I try to integrate the GraphQL project to m production project, it is failing when It tries to Resolve QueryContainer in MainSchema class. Is there any spot that I shoudl be lookign at?
Please see the error at the GraphQL play ground
Thank you for your time!
-
0
The easiest way is to compare the code.
If you can't solve it, it is convenient to share your project source code to: [email protected]?
-
0
Hi maliming , Did you get my email with source code? Please confirm the receipt of the email.
Thank you for your time ad help wit this issue.
Thanks.
-
1
-
0
Thank you @maliming for your time and help. after adding the dependency, as you have specified, it resolved the problem.