helios1138 / graphql-typed-client

A tool that generates a strongly typed client library for any GraphQL endpoint. The client allows writing GraphQL queries as plain JS objects (with type safety, awesome code completion experience, custom scalar type mapping, type guards and more)
MIT License
212 stars 18 forks source link

Fix issue with types with '...on' in their names, like 'transaction' #20

Closed bkniffler closed 4 years ago

bkniffler commented 5 years ago

Not too sure if making 'on_' to 'on' is the right thing to do though.

sladg commented 4 years ago

@helios1138 hi, can you please review/merge this?

sladg commented 4 years ago

Fixes incorrect fragmentation for example in this case: person_profile: { selected_programmes: 1, id: 1, },

Because of the on_.

It might be wise to use regex for matching instead and check for on_ only at the start of string

helios1138 commented 4 years ago

@sladg I see the problem now. This PR however currently does not seem to be fixing it correctly and missing tests. I will push a fix soon.

sladg commented 4 years ago

@sladg I see the problem now. This PR however currently does not seem to be fixing it correctly and missing tests. I will push a fix soon.

thx! appreciate it

helios1138 commented 4 years ago

@sladg fixed with https://github.com/helios1138/graphql-typed-client/commit/b8d467dc4e1ad577678946a7ce18833f5642e2ce

sladg commented 4 years ago

@sladg fixed with b8d467d

Thx a much!