Tag: Asp.Net Core
-
ASP.NET Core and GraphQl problem with JWT Authentication
0 I am building an ASP.NET Core Web API with GraphQl, but I am facing issues with JWT token authentication. When the user is logged in I am returning the token, but when I want to create a query or mutation with token provided I see message The current user is not authorized to access…
-
In graphQL, the first query always takes longer than the next query for the same query
0 I use GraphQL in my Net core application. I discovered that for the same query, the first query took quite a long time (about 1400ms). But when I query again, the time is only 20ms, the next time too. Why? This is my code [UseDbContext(typeof(StudentManagerContext))] public async Task<List<CourseType>> GetAllCourseUsingDataLoader([ScopedService] StudentManagerContext context) { var stopwatch…
-
HotChocolate GraphQL error when child-list is null
0 given this query { name, userList { firstName, lastName } } if userList (which is a list) is null for one object out of hundreds, I end up with this error Value cannot be null. (Parameter ‘source’). Shouldn’t the GraphQL engine detect the null and just ignore it? I’ve tried making the userList property…
-
HotChocolate configure backend property for filter criteria
0 I have a project using HotChocolate and EFCore where I have the following entities: public class Entity { public int EntityId { get; set; } public string Name { get; set; } public string AuthorId { get; set; } } public class Author { public string AuthorId { get; set; } public string Name…
-
Getting error – localhost is currently unable to handle this request. HTTP ERROR 502 – GraphQL run on Visual Studio 2022 – Hotchocolate
0 I am trying to execute a simple default Graphql app on Visual studio 2022 on .net 6 and 7. When the app is executed from visual studio I get the error "localhost is currently unable to handle this request. HTTP ERROR 502". I’m using HotChololate.aspnetcore (13.5.1) App URL "https://localhost:64264/graphql" Note: I have graphql app…
-
How do I implement GraphQL subscription in ASP.NET Core Web API using Graphql.net library?
0 I’m currently working with GraphQL version 7.6.1, graphql.server.transport.websockets version 4.4.1, and graphql.server.transport.aspnetcore version 7.6.0, and I’m struggling to find up-to-date documentation or examples for adding subscriptions to my ASP.NET Core Web API. I attempted to implement subscriptions based on older examples, but due to changes in syntax and other aspects, I’m encountering errors that…
-
Error Configuring GraphQL Subscriptions in ASP.NET Core
1 I am encountering an issue while configuring GraphQL subscriptions in my ASP.NET Core web api. I have followed the documentation and examples, but I’m receiving an error that I can’t seem to resolve. app.UseWebSockets(); app.UseGraphQLWebSockets<GraphQLSchema>("/graphql"); app.UseGraphQL<GraphQLSchema>(); Severity Code Description Project File Line Suppression State Error CS0012 The type ‘ISchema’ is defined in an assembly…
-
Can a GraphQLHttpClient be instantiated against an in memory server
0 Hoping to run integration tests against an in memory server. If I were to create the in-memory server using WebApplicationFactory<Program>, how would I instantiate a GraphQLHttpClient against it? The constructors for GraphQLHttpClient expect an endpoint. I know I could run integration tests against an in memory server in dotnet core 7.0 using an HttpClient…
-
Field true not found on type Site
1 I’m using EntityGraphQL with an asp.netcore app that uses Entity Framework This query works { sites(filter: "id==1") { id name isActive } } But this one fails with: "Field true not found on type Site" { sites(filter: "isActive==true") { id name isActive } } The documentation says I should be able to do that,…
-
GraphQL Server – Addscoped (without explicitly specifying)
0 I am writing a graphql api using .net core+hot chocolate. I have to define all service names while creating graphql server. I have more than 20 service classes. Is there a generic way of specifying these services, I dont want to write 20 + lines of code to specify each service name. addscoped .net…