Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wKich opened this issue Jan 6, 2023 · 0 comments
Open

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

wKich opened this issue Jan 6, 2023 · 0 comments

Comments

@wKich
Copy link
Member

wKich commented Jan 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant