Skip to content

Instantly share code, notes, and snippets.

@rpak
Created July 19, 2017 22:42
Show Gist options
  • Save rpak/c4afa5af0ea9abca31a0a733d2ca77b2 to your computer and use it in GitHub Desktop.
Save rpak/c4afa5af0ea9abca31a0a733d2ca77b2 to your computer and use it in GitHub Desktop.
// zeus.ts
interface User {
firstName: string,
lastName: string
}
interface Entity {
id: string
}
type UserEntity = User & Entity;
// atlas.ts
type GetUserQuery = {
getUser: {
id: string,
firstName: string,
lastName: string
} | null,
}
// some zeus based service
const myResponse: GetUserQuery = { getUser: { id: 'foo', firstName: 'bar', lastName: 'baz' } };
const myUser: UserEntity = myResponse.getUser;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment