thefrontside / playhouse

Frontside's Backstage Portal

Home Page:https://backstage.frontside.services/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[GraphQL-Plugin] Support mapping source data to object type fields

wKich opened this issue · comments

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.