vuex-orm / plugin-graphql

Vuex ORM persistence plugin to sync the store against a GraphQL API.

Home Page:https://vuex-orm.github.io/plugin-graphql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for UNION types

oligus opened this issue · comments

Unfortunately, there is no support for the union type at the moment.

Consider the following schema:

type LicenseValue {
  id: ID
  value: String
  typeObject: ParameterOptionUnion
}

union ParameterOptionUnion = Parameter | Option

type Parameter {
  id: ID
  name: String
}

type Option {
  id: ID
  name: String
  enumerables: Enumerables
}

You would probably need to have a uniontype in the Vuex ORM model itself and have varied return depending on the model using ...on Parameter { ... } and so on.