SAHB.GraphQLClient
SAHB.GraphQLClient copied to clipboard
No upper-case fields
The 'parsing' of query classes etc cannot retain uppercase letters in the names e.g.
public class Query
{
public CharacterOrPerson Hero { get; set; }
}
...
becomes
{"query":"query{hero{name friends{name}}}"}
not
{"query":"Query{Hero{Name Friends{Name}}}"}
Can this be solved?
Hello,
It's possible to chance the GraphQL field name using an attribute. For example:
[GraphQLFieldName("Name")]
public string Name { get; set;}
Alternavively you can override the method GetPropertyField in GraphQLFieldBuilder. The automatic lowercasing of GraphQL name could be optional (using some options) in the future. I Will look into that.
Thanks - that should give me a route to a solution with the current version.