Hey guys, maybe a misunderstanding from our team h...
# prisma-whats-new
v
Hey guys, maybe a misunderstanding from our team here. We're using Prisma and still creating our various schema needed for our app as we're going, and one of them are user specified fields -- a little like Google Forms works -- that could be of different values (Int/String/DateTime). Is this possible in a schema? We've tried setting an interface linking to the various types, with a union for all of the possible types, with no luck. This below is defined in the datamodel.graphql
Copy code
interface Field {
  id: ID! @unique
  name: String!
  type: String!
}

type StringField implements Field {
  id: ID! @unique
  name: String!
  type: String!
  value: String!
}

type IntField implements Field {
  id: ID! @unique
  name: String!
  type: String!
  value: Int!
}

# union FieldValue = StringField | DateTime | IntField | Float | Boolean
union FieldValue = StringField | IntField

type Form {
  id: ID! @unique
  name: String!
  author: User!
  kiosk: Kiosk!
  fields: [FieldValue!]!
}
m
@veksen I'm not on the Graphcool team and I'm not an expert. But I've never seen this on prisma or the framework. It might that what has been implemented in the official Graphql SDL is not fully available in GC's implementation as it stands
v
Hmm thanks, still trying to figure it out, or an alternative
m
You'll probably want
type
to be an
enum!
, not a
String!