graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

codegen: enable ids to be deserialized from strings or integers

Open willfindlay opened this issue 1 year ago • 0 comments

Although not strictly to spec, some upstream graphql implementations such as the start.gg API encode their ID types as integers rather than strings. Prior to this commit, deserialization would fail in such cases, since graphql_client simply type aliases the ID type to a String. This commit introduces a simple deserialization helper that enables us to handle both integers and strings while maintaining backward compatbility for downstream users.

Fixes: https://github.com/graphql-rust/graphql-client/issues/455

willfindlay avatar Mar 09 '24 20:03 willfindlay