integreat-io / integreat

Node.js integration layer
Other
14 stars 3 forks source link

Implement `{ $cast: 'type' }` #215

Closed kjellmorten closed 1 year ago

kjellmorten commented 1 year ago

As a temporary solution, we have casted to schemas with { $apply: 'cast_<type>' }. This is a bit too shaky, and we should provide a dedicated operation object for casting. This will not be supported by map-transform, so we'll probably have to change it to an $apply operation behind the scene. Also, if we will still be using mutations for the actual casting, we can use a more protected id for it, like $$<type> or even a JS Symbol.