dlukez / dataloader-dotnet Goto Github PK
View Code? Open in Web Editor NEWDataLoader for .NET
License: MIT License
DataLoader for .NET
License: MIT License
In the DataLoaderContext.cs, I can not find the method GetOrCreateLoader, but when I reference the project from git directly, the method appears.
I tryed to write some sample for using this library but for me it is doesn't works.
Example this:
var result = await DataLoaderContext.Run(loaderCtx => loaderCtx.Factory.GetOrCreateLoader("a", async () => await new Task<string>(() => "aaa")).LoadAsync()
Can somebody tell me what I have wrong in the my example?
I've changed this to optionsBuilder.UseSqlServer("<connection string>")
(and installed the appropriate nuget packages).
This works:
{
"query": "query { episodes { name } }"
}
This doesn't:
{
"query": "query { episodes { name characters { name } } }"
}
All queries that use dataloader do not work. The request just hangs there, seemingly stuck in an infinite loop... could it be something related to async/await?
Debugging the code, it seems the task returned by LoadAsync never gets completed.
P.s. As an aside, InitTestData()
fails because it tries to insert ids with identity insert off.
How to use this with Connection Method instead Field dot net
I am working on a data-intensive application that uses GraphQL dot net and I was hoping to solve the N+1 issue with dataloader-dotnet, but I have run into an issue I posted on a related repository.
However, @dlukez my question is - is this repository going to updated / maintained?
Is this still on development or can I use it ?
While inspecting this implementation I've noticed the GetOrAdd
usage here could be problematic.
Say, if two threads get in the add factory method for the same loader at the same time, wouldn't both threads receive a different loader but only one get stored in the dictionary? (Which would mean only one will get executed and as a result the users code will deadlock).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.