This PR addresses an issue with the C# code generator. When a GraphQL schema contains reserved keywords as parameter names, the result is invalid C# code.
For instance, a GraphQL schema like the one below:
type Query {
example(object: Data): String
}
would generate the following invalid C# code:
public string? Example(Data? object) // Syntax error
This is because object is a reserved keyword in C#.
To resolve this, the PR introduces a check in the generator to escape reserved keywords with the '@' character.
Using the same GraphQL schema as above, the generator now produces the following valid C# code:
This PR addresses an issue with the C# code generator. When a GraphQL schema contains reserved keywords as parameter names, the result is invalid C# code.
For instance, a GraphQL schema like the one below:
would generate the following invalid C# code:
This is because
object
is a reserved keyword in C#.To resolve this, the PR introduces a check in the generator to escape reserved keywords with the '@' character.
Using the same GraphQL schema as above, the generator now produces the following valid C# code: