cajuncoding/GraphQL.RepoDB

How to use GraphQL.RepoDB without Azure?

ZedZipDev opened this issue · 5 comments

Is it possible to use GraphQL.RepoDB without Azure packages?

Yes absolutely! They don’t have any dependencies between each other.

The demo project is merely using Azure Function as an example that serves multiple purposes.

The Azure Function proxy library only enables HotChocolate to run within the context of Azure Functions v2 & V3. Otherwise it has no affect on the execution pipeline, field middleware, or resolvers.

The RepoDB extensions work with the Hot Chocolate field middleware/resolvers within the execution pipeline to provide a simplified facade and ready-to-use mapping implementation directly for RepoDB micro-orm. It works with any deployment of Hot Chocolate (eg .Net Core Web App, Azure Functions, etc.).

I strongly recommend spending time to get a solid understanding of how HotChocolate v11 configuration/startup works.

Thank you, I will try to test this way. But will ask questions if have ;-)

In that case I need to use the same NuGet packages as you wrote in readme?

Sure, but be sure to read the documentation provided by the HotChocolate core team and the Workshop!

The difference is that GraphQL.RepoDB makes it a lot easier to work without IQueryable or Entity Framework dependency. And it does this inside the resolver…

So anytime you would normally inject IResolverContext in HC workshop or docs, now with GraphQL.RepoDB you have another option to now inject IParamsContext which is an easier to use facade…and the library offers another helper that uses that to work more easily with RepoDB micro-orm by automatically mapping to RepoDB models, fields, sort args, etc.

All outlined in the readme examples and demo project.

If any of this isn’t clear then it will be much easier to understand once you’ve got a grasp of GraphQL & HotChocolate fundamentals :-)

Ok, thank you. So what NuGet packages should I use in my ASP.NET Server when I need only HC without EF and without Azure functionality ?
Is this right minimal set:

  1. GraphQL.PreProcessingExtension
  2. GraphQL.RepoDb.SqlServer
    ?

Yes… all you need to install is: GraphQL.RepoDB.SqlServer, it’s dependencies will automatically be installled by Nuget. Again this is also outlined in the readme here..

And you will have to install RepoDB itself…