[GraphQL-Plugin] Support mapping source data to object type fields
wKich opened this issue · comments
Dmitriy Lazarev commented
For example we'd like to group some fields into specific object type:
type Address {
zip: String!
country: String!
city: String!
street: String!
house: String!
apartment: String
}
interface IPerson @extend(interface: "IUser", when: "kind", is: "Person") {
address: Address
}
And entity's structure looks like:
interface PersonEntity extends Entity {
kind: "Person";
spec: {
zipCode: string;
country: string;
city: string;
street: string;
house: string;
apartment?: string;
/* ...rest fields... */
};
}
Right now @field
directive allows map only primitive types, like string/numbers/arrays or objects 1:1. But there is no way to implement that case from above.