Client fields currently are scalars, in the sense that you cannot use {}, as in my_client_field { ... }.
Client fields should be able to return IDs, in which case, you would be able to do best_friend_client_field { name }
This needs additional thought:
How do we enable lazy fetching? As in, we calculate best_friend_client_field, and then execute the operation node(id: $bestFriendId) { ... on User { name } }
Do we want to force the user to opt into this? (As in the @waterfall directive in Relay?)
The syntax I'm thinking of is pointer Type.fieldName to Type { ... }
{}
, as inmy_client_field { ... }
.best_friend_client_field { name }
best_friend_client_field
, and then execute the operationnode(id: $bestFriendId) { ... on User { name } }
@waterfall
directive in Relay?)pointer Type.fieldName to Type { ... }