Skip to content

Commit

Permalink
Merge pull request #55 from fossapps/hotfix
Browse files Browse the repository at this point in the history
fix(gql): fix resolve reference error
  • Loading branch information
cyberhck authored Jun 5, 2021
2 parents 1393d03 + aacc1da commit b87b486
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Micro.Auth.Api/GraphQL/Types/UserType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Micro.Auth.Api.GraphQL.Types
{
public sealed class UserType : FederatedObjectGraphType<User>
{
public UserType(SessionByUserDataLoader sessionLoader)
public UserType(SessionByUserDataLoader sessionLoader, UserByIdDataLoader userLoader)
{
Name = "User";
Key("id");
Expand All @@ -25,10 +25,7 @@ public UserType(SessionByUserDataLoader sessionLoader)
ResolveReferenceAsync(async ctx =>
{
var id = ctx.Arguments["id"].ToString();
return new User
{
Id = id,
};
return await userLoader.LoadAsync(id).GetResultAsync();
});
}
}
Expand Down

0 comments on commit b87b486

Please sign in to comment.