Hot Chocolate is an open-source .NET GraphQL server platform developed by ChilliCream. Use this tag for questions about code written using Hot Chocolate or for queries concerning the official documentation.
Questions tagged [hotchocolate]
393 questions
1
vote
0 answers
GraphQL queries with multiple dbcontext and varying connectionstrings
I'm trying to extend an older application with a new Web API and GraphQL / Hotchocolate was chosen as the technology to go.
The underlying SQL Server database consists of at least 3 databases.
"at least" means, there can be more databases, depending…

Holger
- 25
- 1
- 7
1
vote
1 answer
ASP.NET CORE Hot Chocolate query error for nested object
I am learning how to write GraphQL in asp.net core 5 project. I am using Hot Chocolate v5 and got an error when executing the following query:
query
{
platform
{
id
name,
commands
{
id
howTo
commandLine
}
…

Wasyster
- 2,279
- 4
- 26
- 58
1
vote
1 answer
GraphQL HotChocolate no compatible constructor find for input type
This is the exception being raised:
I goes it has something to do with not being able to resolve my base class.
public class Project : BaseEntity
{
public string Name { get; private set; }
public string Description {…

Temp034
- 141
- 11
1
vote
1 answer
How can I return an unauthorized result from a custom attribute?
I'm trying to implement a custom authorization attribute with HotChocolate.
What I have so far is this
namespace GraphQL.Attributes
{
public class AuthorizeAttribute : ObjectFieldDescriptorAttribute
{
public override void…

Slamdunk
- 424
- 1
- 8
- 20
1
vote
1 answer
How to modify Response Cookie in GraphQL using Hot Chocolate in .Net 5
I am building a GraphQL API using Hot Chocolate(.net 5) and need to add authentication using the JWT token.
In REST API, I have used http only cookie to add the refresh token.
var cookieOption = new CookieOptions
{
HttpOnly = true,
Expires =…

Ash
- 447
- 2
- 6
- 19
1
vote
1 answer
HotChocolate GraphQL filtering on GUID
I have very limited knowledge on GraphQL as I am still in the learning process. Now I stumbled upon an issue that I cannot resolve by myself without some help.
I'm using HotChocolate in my service.
I have a class ConsumerProductCategory with a Guid…
user4149157
1
vote
0 answers
In HotChocolate, is there a way to use customized authorization?
I'm looking for a way to use a customized method to authorize and return BOOLEAN value.
Instead of using the official way
descriptor.Authorize(new[] {"Admin"});
Is there a way to use my own service to do that? Something like
bool isAuthorized =…

Bye
- 732
- 8
- 29
1
vote
0 answers
Is it possible to modify the type name in a query graphql
I explain my situation :)
A server/client is sending me this query :
query MultiTenancy__GraphQLAPI__FindMatchesQuery($name: String!, $email: String!, $registrationNumbers: [RegistrationNumberAttributes!]!, $phoneNumber: String,
$birthDate:…

Bruno Bernard
- 11
- 2
1
vote
0 answers
Authorization and Authentication in Hot Chocolate with Auth0
After have tried this exact thing with REST and Controllers (all working) I would like to use GraphQL instead. The ScopeHandler doesn't seem to be called at all (it did in REST).
I don't really know where I should put my [Authorize] annotation. In…

Kryptor
- 53
- 5
1
vote
0 answers
Setting up Windows Authentication for a GraphQL endpoint built using HotChocolate framework and ASP.NetCore 5.0
I am currently trying to set up windows authentication for a graphql endpoint. Currently all my requests are being blocked, even schemas are not getting loaded. I have followed the traditional way of setting up the windows authentication in…

Avinash Rao
- 11
- 1
1
vote
1 answer
Declare Array of Non-Nullables using Annotation-Based HotChocolate
I can't figure out how to make it so that the elements of the array are non nullable using annotation-based HotChocolate. I'm looking to create a gql schema for my class that looks like:
foos: [Foo!]!
However, at the moment all I've been able to…

MrMeik
- 41
- 4
1
vote
0 answers
Hot Chocolate GraphQL batching error when using a stitched schema
I have two 3 Hot Chocolate GraphQL endpoints. Two of these are for separate services; the third endpoint is a "gateway" which uses schema stitching to merge the schemas from the other two endpoints. At the moment I'm just doing a basic merge of…

user1443986
- 77
- 10
1
vote
0 answers
Graphql hotchocolate - How to stitch 2 schemas from public rest api in dotnet
My goal is to use 2 public apis such as https://randomuser.me/api and universities.hipolabs.com/search?country=Australia
Build a gateway to retreive object results from both APIs.
For example use "country" in randomuser api and fetch universities by…

4u2c
- 88
- 1
- 11
1
vote
1 answer
GraphQL - Execution Error (The parent cannot be cast to..)
I am trying to implement GraphQL in web API. The method is working fine when return object type. But it is throwing an error while I am trying to return Object List.
public class MyData
{
public int Code { get; set; }
public…

Ullan
- 905
- 4
- 15
- 28
1
vote
0 answers
Hot Chocolate GraphQL - Stitching - extending types and passing in multiple ids
I would like to find out if it is possible to extend a type like the example below where instead of passing in one id (sourceContactId) it is possible to pass in multiple ids. The reason being is that at the moment it will call the contactById…

sspikker
- 11
- 1