Questions tagged [graphql-dotnet]

Use for the GraphQL .NET project.

Tag for the GraphQL .NET project.

https://github.com/graphql-dotnet/graphql-dotnet

105 questions
1
vote
2 answers

GraphQL is returning extra information which is slowing down the initial loading

I am getting some extra information within my graphql results. Apart from the data and the end errors I am getting document operation perf extensions so the result is getting quite bulky. The other think I've noticed is that the initial loading of…
1
vote
0 answers

How can I add custom operation to Azure Application Insights's Performance tab?

We have a GraphQL api that runs on .Net Core. Since all queries are made to the /graphql endpoint we only get one operation "POST /graphql" on the performance page of Azure Application Insights while a REST API would have allowed Aplication Insights…
1
vote
1 answer

GraphQL .NET - extensions in results

I'm starting out with GraphQL for .NET Core 3.1 (https://github.com/graphql-dotnet/graphql-dotnet). I have built a simple example from what I have seen online (not a lot of information out there yet about it). When I do a query I get a result like…
developer82
  • 13,237
  • 21
  • 88
  • 153
1
vote
0 answers

Configuring GraphQL.Server.Authorization and IdentityServer

I'm trying to configure GraphQL-dotnet authentication with IdentityServer 4, but failing to get the token validation working. In UI-playground, I'm using the Chrome ModHeader extension to add the auth header, but it seems like api not registering…
CraigM
  • 561
  • 8
  • 20
1
vote
1 answer

GraphQL.NET dynamic field type

I'm trying to add an object to my GraphQL.NET model, but I'm having a problem with one of the fields. The original class is public class ShowCriterion { public string RelatedEntity { get; set; } public object MatchValue { get; set; } } This…
David784
  • 7,031
  • 2
  • 22
  • 29
1
vote
1 answer

GraphQL .NET: middleware problems with singleton schema

I'm using GraphQL on a .NET core website/controller. The schema is quite large, such that the constructor takes about a second to run. I couldn't have that kind of overhead on every request, so I created the schema as a singleton, shared between all…
David784
  • 7,031
  • 2
  • 22
  • 29
1
vote
0 answers

GraphType first schema endpoints using ListGraphType or using Connection

I am setting up endpoints for 3 types (let's say Student, Classmate and Pet), where Student has many Classmates and many Pets. I figured out 2 options: the first is to create a FriendsInterface and have Classmate and Pet implement that interface…
1
vote
2 answers

Null context with GraphQL DataLoader

In my project that uses graphql-dotnet, I unexpectedly started getting errors saying the DataLoader context was null: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the…
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
1
vote
0 answers

What are best practices for graphql mutations? (.NET implementation)

I am currently learning graphql and I am not sure if I correctly understand how mutations are supposed to work, especially when combined with subscriptions. I have a page with client details, that include a description and a list of software…
kanpeki
  • 435
  • 2
  • 6
  • 20
1
vote
1 answer

context.GetArgument() returning null with ByteGraphType

I´m learning how to use CustomScalar in graphql-dotnet. I have a tinyint column in my table and from what I have read, I´m supposed to use byte on this column in C#. After research I found out that I need to create a ByteGraphType, but I´m having…
1
vote
1 answer

graphql-dotnet query by operation name

I am using a graphql-dotnet to build a graphql server in Net Core 2.2 Web API. Schema description: I have a ObjectGraphType like below public class UserType : ObjectGraphType { public UserType() { …
Alexcei Shmakov
  • 2,203
  • 3
  • 19
  • 34
1
vote
1 answer

http://localhost:49915/api/graphql not working on updating the Route of GraphQL controller

I updated the Route value from [Route("[controller]")] to [Route("api/graphql")] for the below mentioned GraphQLController. [Route("api/graphql")] public class GraphQLController : Controller { private readonly IDocumentExecuter…
santosh kumar patro
  • 7,231
  • 22
  • 71
  • 143
1
vote
1 answer

Different DI scope for controller and queries in graphql-dotnet?

I'm trying to implement a grahql-dotnet API. I'm running into some weird behavior when I try to pass a scoped object into my controller and the same object into some of my services used by the queries using dotnet core dependency injection. It…
Will P.
  • 8,437
  • 3
  • 36
  • 45
1
vote
1 answer

How to call Grpahql with .Net core from a React component using Axios?

I am new to graphql and trying to implement Graphql with dot net core using graphql-dotnet library. We do not have a dedicated database in this application. The high level flow of the application is Front End(React) (Calls) > GraphQlController…
ankur
  • 4,565
  • 14
  • 64
  • 100
1
vote
1 answer

How to DI repository into Type-class?

Need some help here please ... I'm looking at the example "graphql-dotnet/server" where the exposed objects contains just plain properties. But what if I need to resolve a property and get data from a repository, how can I get hold of the…
user3360458
  • 63
  • 1
  • 5