halborg
06/20/2018, 8:15 AMinfo
object in our resolvers? We can’t pass it on unmodified, as the AST would not match the DB schema.
I can’t find any examples or documentation about it, and it seems to me to be a main component of Prisma that the app schema and DB schema are separated and can evolve separately, so there must be some better way than to do string manipulation, right?Avi Block
06/20/2018, 10:15 AMhalborg
06/20/2018, 10:16 AMAvi Block
06/20/2018, 1:41 PMhalborg
06/21/2018, 12:02 PMinfo
object automatically between the app and DB layer.Avi Block
06/21/2018, 12:10 PMhalborg
06/21/2018, 4:12 PMprisma-bindings
correctly generates the DB schema and .ts
definitions, the problem is that the info
object that gets passed along won’t be understood by Prisma, seeing as the DB schema won’t know of those datatypes that only exist in the app schema.halborg
06/21/2018, 4:15 PMprisma-bindings
excel if it is the DB schema that has extra types, and the app schema is only a subset of the DB. However, if types like our Boundary
type only exist in the app schema, we run into this issue, and I think this might become a more general problem in time as other projects come up with use cases for an app schema that contains types the DB does notAvi Block
06/21/2018, 5:08 PMhalborg
06/21/2018, 5:10 PMhalborg
06/21/2018, 5:11 PM{
user {
group { // group has a boundary
value {
name { // name has a boundary
value
}
}
}
}
}
into
{
user {
group {
name
}
}
}
halborg
06/21/2018, 5:12 PMBoundary
adds the
canView: Boolean!
message: String!
value: String
wrapper object around the DB types (or in this case, the scalar type String
. If instead of StringBoundary
it was i.e. UserBoundary
, the value
field would be of type User
)