byme8 / ZeroQL

C# GraphQL client with Linq-like syntax
MIT License
278 stars 13 forks source link

Wrong name case in query #34

Closed Jemy191 closed 1 year ago

Jemy191 commented 1 year ago

Is that expected behavior?

Describe the bug The query that is constructed from my code does not have the right case for the name. They are always lower case.

Expected behavior The constructed query uses the real type not the lower case one.

var response = await client
.Query(static c => c.QueryClient(null, null, null, null, c => new { c.Name , cars = c.Cars(null, null, null, c => c.Brand) }));

Schema

type Client {
  id: ID!
  name: String! // for testing if making it lowercase in the schema work
  Cars(filter: CarFilter first: Int offset: Int): [Car!]
  CarsAggregate(filter: CarFilter): CarAggregateResult
}

type Car {
  id: ID!
  Brand: CarBrand!
  Owners(filter: ClientFilter order: ClientOrder first: Int offset: Int): [Client!]
  OwnersAggregate(filter: ClientFilter): ClientAggregateResult
}
query { queryClient(filter: null, order: null, first: null, offset: null) { name cars(filter: null, first: null, offset: null) { brand }  } }
Error: Cannot query field "cars" on type "Client". Did you mean "Cars"?

Environment (please complete the following information):

Additional context I'm using Dgraph cloud as my GraphQL provider.

byme8 commented 1 year ago

It is a bug. During the generation, it converts everything to a lowercase. I will have a look.

byme8 commented 1 year ago

@TheJemy191 checkout v3.5.1-preview.1 the issue should be fixed.