Hi I have the following query class:
public class haProgrammesQuery
{
[UseFiltering]
public async Task<IQueryable<User>> GetUsers([Service] haProgrammesContext Context) => Context.Users;
[UseFiltering]
[UseFirstOrDefault]
public async Task<IQueryable<User>> GetUserById([Service] haProgrammesContext Context, string Id) {
return Context.Users.Where(u => u.UserId.ToString() == Id);
}
}
which works fine in playground using the query:
query {
users{
userId
name
}
}
but the query
query{
userById(id:"fd8b8670-60cf-451a-8fea-0fc0c69cde3a")
{
name
}
}
calls the UserById method (checked using a breakpoint) but the string Id
argument is null and thus the response is null back to playground.
I have also played with a basic echo method to return the string argument back but that also has a null argument received and also played with async Task<IQueryable<User>>
(as this version is and yes I know it is not using awaiting) and also just the standard IQueryable<User>
just to se if there was anything there - what am I dong wrong?!