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

Dimension Type Hierarchy Improvements #81

Open
RickMoynihan opened this issue Jan 9, 2018 · 0 comments
Open

Dimension Type Hierarchy Improvements #81

RickMoynihan opened this issue Jan 9, 2018 · 0 comments

Comments

@RickMoynihan
Copy link
Member

Moving suggestion from comment on issue #55 here.

We should improve the type hierarchy around dimensions, resources and dimension values.

As a first cut I'd suggest something like this (taken from comment), but we should discuss more:

interface Resource {
  uri: ID!
  label: String!
}

interface Dimension {
  uri: ID!
  label: String!
}

interface DimensionValue {
  uri: ID!
  label: String!
}

type DefaultDimension implements Dimension {
  uri: ID!
  label: String!
  values: [DimensionValue]  
}

type DefaultDimensionValue implements DimensionValue {
  uri: ID!
  label: String!
}

type EnumDimensionValue implements DimensionValue {
  uri: ID!
  label: String!
  enum_name: String!
}

type EmumDimension implements Dimension { 
  values: [EnumDimensionValue]
}

type HierarchicalValue implements DimensionValue { # i.e. could be a RefAreaValue
  uri: ID!
  label: String!
  children: [DimensionValue] # NOTE you can't have recursive datatypes in graphql :-( but we could potentially improve later by generating more specific types for each area level etc...
}

type HierarchicalDimension implements Dimension { # i.e. could be a RefAreaDimension
  values: [HierarchicalValue]
}
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