Skip to content

Conversation

@dariuszkuc
Copy link
Collaborator

@dariuszkuc dariuszkuc commented Jul 22, 2022

📝 Description

Update kotlinx-serialization handling of custom scalars to allow non-primitive values. While custom scalars are most often represented as some primitive value (e.g. UUID -> String), there are use cases when scalars need to be represented as objects. One common use case is Apollo Federation and its usage of _Any scalar to represent arbitrary entity object map that contains various fields to uniquely identity it.

Updated custom scalar documentation with examples n how to use arbitrary objects as custom scalars.

🔗 Related Issues

Resolves:

@dariuszkuc dariuszkuc added changes: minor Changes require a minor version module: client Issue affects the client code labels Jul 22, 2022
@dariuszkuc dariuszkuc force-pushed the client-custom-scalars branch from 28e2288 to b8443c9 Compare July 22, 2022 22:57
@dariuszkuc dariuszkuc marked this pull request as ready for review July 22, 2022 22:58
@dariuszkuc
Copy link
Collaborator Author

dariuszkuc commented Jul 22, 2022

FYI only code change is in com.expediagroup.graphql.plugin.client.generator.types.generateGraphQLCustomScalarConverters. All other changes are related to unit testing, updating examples and writing documentation.

Update `kotlinx-serialization` handling of custom scalars to allow non-primitive values. While custom scalars are most often represented as some primitive value (e.g. UUID -> String), there are use cases when scalars need to be represented as objects. One common use case is Apollo Federation and its usage of `_Any` scalar to represent arbitrary entity object map that contains various fields to uniquely identity it.

Updated custom scalar documentation with examples  n how to use arbitrary objects as custom scalars.

Resolves:

* ExpediaGroup#1408
* ExpediaGroup#1435
* ExpediaGroup#1445
@dariuszkuc dariuszkuc merged commit 186c46f into ExpediaGroup:master Jul 26, 2022
@dariuszkuc dariuszkuc deleted the client-custom-scalars branch July 26, 2022 03:28
dariuszkuc added a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
Update `kotlinx-serialization` handling of custom scalars to allow non-primitive values. While custom scalars are most often represented as some primitive value (e.g. UUID -> String), there are use cases when scalars need to be represented as objects. One common use case is Apollo Federation and its usage of `_Any` scalar to represent arbitrary entity object map that contains various fields to uniquely identity it.

Updated custom scalar documentation with examples  n how to use arbitrary objects as custom scalars.

Resolves:

* ExpediaGroup#1408
* ExpediaGroup#1435
* ExpediaGroup#1445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes: minor Changes require a minor version module: client Issue affects the client code

Development

Successfully merging this pull request may close these issues.

2 participants