nreco / data

Fast DB-independent DAL for .NET Core: abstract queries, SQL commands builder, schema-less data access, POCO mapping (micro-ORM).
https://www.nrecosite.com/dalc_net.aspx
MIT License
184 stars 39 forks source link

GraphQL Column Resolver and Column Cases #58

Closed xavidram closed 4 years ago

xavidram commented 4 years ago

GraphQL Column Resolver Lower Cases the first letter of the column, causing an issue when mapping to dictionary.

image

My columns for example are ID, FirstName, and LastName. The resolver forms them in the Schema into iD, firstName, and lastName. When I search for ID, FirstName, and LastName, it prompts me if I meant iD, firstName, and lastName. When I update the GraphQL query to look for the first letter lower case column name, it then cannot find in the column dictionary because those names are queried from the Table itself.

Is there a way I can tell the resolver not to change the naming convention of the columns? Or I will have to manually change them all to lower case somewhere else.

xavidram commented 4 years ago

I ended up changing that line to find the first or default, and use a string comparer to ignore case. Seems to work. And I also set all the column names to lower case when setting up the columnmentadata

MakaBuka commented 4 years ago

I ended up changing that line to find the first or default, and use a string comparer to ignore case. Seems to work. And I also set all the column names to lower case when setting up the columnmentadata

You're running NReco.Data example or using component itself? Mean - it's just an example, but commercial component much more mature and have schema field validation on Resolve step.

xavidram commented 4 years ago

I wanted to test out the NReco.Data example. I am using the NReco.GraphQL component in another project and it does work wonderfully. I simply wanted to follow the example to better understand the NReco.Data package. I got it working though.

Thank you for the awesome package.

VitaliyMF commented 4 years ago

I simply wanted to follow the example to better understand the NReco.Data package.

That's cool! In fact NReco.Data library is pretty small, and I may recommend to review its source code to clarify how it works and what to expect from API calls. Lib documentation is definitely incomplete -- this is because I don't have much time for this.