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
4
votes
1 answer

Can I represent my .NET dictionaries as JSON dictionaries in my GraphQL?

When I'm serialising to JSON, I'm used to .NET dictionaries becoming objects with the keys as properties and the values as their values. (The Json.Net docs have a succinct example.) I'm using GraphQL and struggling to achieve a similar result. My…
Tom Wright
  • 11,278
  • 15
  • 74
  • 148
3
votes
0 answers

Method not found: GraphQL.ExecutionOptions.set_NameConverter in netcoreapp2.2

I need to integrate GraphQL in NetCoreApp 2.2 netcoreapp2.2 (I can't upgrade to NetCore 3 for other reasons). PS. We have another project in .Net Core 3.1 and we can use…
TTCG
  • 8,805
  • 31
  • 93
  • 141
3
votes
2 answers

Can I use graphql-dotnet without Entity Framework?

Can I use graphql-dotnet without Entity Framework? I'm currently looking at this repository https://github.com/mmacneil/fullstack-jobs, and noticed that it is using EF. And everywhere I look on the internet for examples, I can only find…
NZ Scotty
  • 105
  • 1
  • 7
3
votes
0 answers

GraphQL json parser and AllowSynchronousIO

I'm starting to implement GraphQA in .NET with https://github.com/graphql-dotnet/server, I wrote a very simple sample application and while running Graphiql I got the following error: fail:…
developer82
  • 13,237
  • 21
  • 88
  • 153
3
votes
1 answer

how to inject a database context in graphql-dotnet

ConfigureServices services.AddSingleton(c => new FuncServiceProvider(type => c.GetRequiredService(type))); services.AddDbContext(options =>…
420skun
  • 99
  • 4
3
votes
2 answers

How to access arguments in nested fields in ASP.NET Core GraphQL

I have a query with the field "statistics" which is a sub-query with three different accumulated values. I would like to be able to give statistics a country argument and then access that argument in the resolvers for the different fields in the…
Sune Monrad
  • 146
  • 7
3
votes
1 answer

GraphQL + Autofac

I'm exploring GraphQL at the moment. In one of my ObjectGraphTypes I want to inject a service implementation which queries EF about some addition data. public class RoomType : ObjectGraphType { public RoomType(IUserRepository…
Tobias Moe Thorstensen
  • 8,861
  • 16
  • 75
  • 143
3
votes
0 answers

Field resolver for InputObjectGraphType

I work on a ASP.NET Web API and have added support for GraphQL requests with GraphQL for .NET . My queries are working as expected but I am now struggling to use the same logic with the mutations. I have the following logic for my…
webStuff
  • 1,468
  • 14
  • 22
3
votes
2 answers

Defining FieldNameConverter inside GraphQL.Types.Schema is not working in asp.net core

I am using graphql-dotnet and graphql-dotnet server with asp.net core. I have configured schema in following way. public class PdsGraphQlSchema: Schema { public PdsGraphQlSchema() { FieldNameConverter = new…
Hasibul
  • 569
  • 2
  • 6
  • 21
3
votes
3 answers

How to send oauth_token and client_id in the request body of GraphQL Client endpoint in c#

Hello friends I want pass oauth_token and client_id in request body of a GraphQL Client. So how can I pass them, because GraphQLRequest has only three fields (i.e Query , Variables and OperationName). Please suggest. using GraphQL.Client; var…
Aryan
  • 31
  • 1
  • 4
2
votes
2 answers

GraphQL models struggling with System.Text.Json.JsonException

I created a new .NET Core project and installed the packages GraphQL, GraphiQL and GraphQL.SystemTextJson. When running the application this is what I get Besides the exception message GraphiQL wasn't able to find a schema documentation. First of…
user13755987
2
votes
1 answer

How to deal with multiple queries for each resource?

I want to create a GraphQL API with .NET Core using the GraphQL and GraphiQL package. I created one query for users and one for tasks public sealed class UserQuery : ObjectGraphType { private List users = new List(); public…
user13755987
2
votes
0 answers

How do I handle empty response in GraphQL query using GraphQL for dotnet?

We are using the GraphQL client NuGet package (https://github.com/graphql-dotnet/graphql-client) and in our .NET 4.7.2 solution, we are currently, calling an GraphQL API like this: protected SomeService(ILogger logger, IGraphQLClient client) { …
Hos
  • 583
  • 1
  • 6
  • 25
2
votes
1 answer

Any good examples on usage of AutoRegisteringObjectGraphType with GraphQL.net

Can anyone help me to get some sample code with examples regarding usage of AutoRegisteringObjectGraphType with asp.net core project? I did not find any concrete examples with documentation. Any help on this is much appreciated.
santosh kumar patro
  • 7,231
  • 22
  • 71
  • 143
2
votes
2 answers

GraphQL .NET Core Visual Studio 2019 wrong suggestions

I'm practicing with graphql-dotnet. I created a PropertyQuery as follows: public class PropertyQuery : ObjectGraphType { public PropertyQuery(IPropertyRepository propertyRepository) { Field>( …
Minh Giang
  • 631
  • 9
  • 28