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 PascalCaseFieldNameConverter();
Query = CommonServiceLocator.ServiceLocator.Current.GetInstance<GraphQlQueries>();
Mutation = CommonServiceLocator.ServiceLocator.Current.GetInstance<GraphQlMutations>();
}
}
Here I have added FieldNameConverter = new PascalCaseFieldNameConverter()
; but i am not getting the changes at output. Output always camelCased. How i can ignore camel casing or use Pascale casing.
For ConfigureServices I have used following
services.AddGraphQL(_ =>
{
_.EnableMetrics = true;
_.ExposeExceptions = true;
});
services.AddSingleton();
and inside Configure
I have used following
app.UseGraphQL<PdsGraphQlSchema>();
app.UseGraphQLPlayground(new GraphQLPlaygroundOptions
{ Path = "/ui/playground" });
Expecting your help.
you must use from NameConverter field in your schema
you have 3 options
1- DefaultFieldNameConverter() without Change,You see what you wrote in the output
2- PascalCaseFieldNameConverter() in the all First Charecter to Lowercase
3- CamelCaseFieldNameConverter() in the all First Charecter to Lowercase