Tag: c#
-
Why ‘char -> int’ is promotion , but ‘char -> short’ is conversion (but not promotion)?
11 I’ve read this Integral promotion: prvalues of small integral types (such as char) may be converted to prvalues of larger integral types (such as int). – first line […details – not important…] Note that all other conversions are not promotions; for example, overload resolution chooses char -> int (promotion) over char -> short (conversion).…
-
C# accessing properties belonging to instance which is of object? (i.e. Nullable) type
0 Here is info about our technical development environment : • .NET 6 • C# 10 • GraphQL 7.1.1 • GraphQL.Client 5.1.0 • GraphQL.Client.Serializer.Newtonsoft 5.1.0 GraphQLRequest request = new GraphQLRequest { Query = @" mutation FaxReceiverInfo( $_DateCreated: datetime, $_FaxNumber: String, $_FaxRecord: uniqueidentifier, $_Reason: String ) { insert_vw_EmailDeliveryRecordDetail_one ( object: { DateCreated: $_DateCreated, FaxNumber: $_FaxNumber, FaxRecord:…
-
Benefit of endless-loops without side-effects in C++ being UB compared to C?
19 In C++ loops as for(;;) {} are UB, whereas they are not in C? In https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2809r0.html it is expressed that there are good reasons for doing so. Are there any simple examples to make that clear? c++ c loops optimization undefined-behavior Share Improve this question Follow asked 17 hours ago wimalopaanwimalopaan 4,60811 gold badge1919…
-
Invalid cast Microsoft.EntityFrameworkCore.HierarchyId
0 I use GraphQl to fetch the data, here is my method in order to get the result based on category ID. public IQueryable<Product> GetActiveProducts( string categoryId, CancellationToken cancellationToken ) => return _dDbContext.Categories.Where(x => x.Id == categoryId); Also, my entity is as follows: public class Category:IEntityHierarchy { public string Id { get; set; } //…
-
Unity returns “400 (Bad Request) Error” on sending login-mutation to local graphql-server
0 i try to login into my local graphql-server from unity. the mutation works from apollo-client and postman, but with the unity.webrequest i get 2 errors. the first one: Network error: HTTP/1.1 400 Bad Request UnityEngine.Debug:LogError (object) GraphApi/<LoginMutation>d__3:MoveNext () (at Assets/GraphApi.cs:61) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr) and the second: Response body: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8">…
-
How I can pass GraphQL header in ASP.NET Core 6?
0 I use ASP.NET Core to consume GraphQL API and everything working fine, just I need pass the header because I need to use Arabica language and I don’t know how I can pass it. So I need to change language to "ar" when header is passing. [HttpPost] public async Task<IActionResult> Tracking(string code) { var…
-
How to hide fields for different graphql types which return the same type for GraphQL HotChocolate
1 I created 2 different methods using GraphQL HotChocolate which return the same object type. I need to hide different fields for each method. However, it does not happen when I look at the schema definition. This is an example for code first approach: public class Query { private readonly CharacterRepository _repository; public Query(CharacterRepository repository)…
-
Hot Chocolate GraphQL – MaxExecutionDepth not working
1 How do I get MaxExecutionDepth to work in Hot Chocolate GraphQL? Here is my code: // Add GraphQL Services services.AddGraphQL( SchemaBuilder.New() // enable for authorization support .AddAuthorizeDirectiveType() .ModifyOptions(o => o.RemoveUnreachableTypes = true) .Create() .MakeExecutable( builder => builder .UseDefaultPipeline() .AddErrorFilter<UseExceptionMessageErrorFilter>() .AddOptions( new QueryExecutionOptions() { MaxExecutionDepth = 15 })) .Schema); I’ve tested with this, even changing…
-
Why is the constructor of a global variable not called in a library?
8 I have some legacy code with some singleton classes that register themselves using constructors of global variables. It’s a large codebase, that’s compiled into one executable. I have tried to organize the code base and regroup code into libraries. A minimal example of the current code is main.cpp int main(int argc, char *argv[]) {…
-
How can I have complex dictionary type attributes
0 I’m using graphql/hotchocolate in my app and I have the following structure: public record PriorInjury(IDictionary<Location, Injure>? Injuries) public record Location(Enums.BodyPart BodyPart, Enums.Side Side, Enums.FrontOrBack FrontOrBack); public record Injure(Enums.PainLevel Level, Enums.HowOftenInjureHurts HowOften, Enums.SinceWhenInjured Since); This is my command: public record AddInjuryCommand(PriorInjury? PriorInjury) : ICommand<Guid>; This code is throwing: InputObject `PriorInjurySortInput` has no fields declared. (HotChocolate.Data.Sorting.SortInputType<PriorInjury>)…