remorses / genql

Type safe TypeScript client for any GraphQL API
https://genql.dev
MIT License
881 stars 37 forks source link

Field names that start with on_ will get a bad query #182

Open lukepolo opened 2 months ago

lukepolo commented 2 months ago

my schema has a on_demand field, but in the code it thinkts it should be fragment

  if (f.startsWith('on_')) {
                    ctx.fragmentCounter++
To query some fields only on a certain type you can use graphql fragments
In genql you can express the fragments for union and interface types using the on_ prefixed fields in a query

any work arounds?

linear[bot] commented 2 months ago

GEN-35 Field names that start with on_ will get a bad query

lukepolo commented 2 months ago

for now i just changed it to is_on_demand, but i think we can detect thing, i can look in a bit