How do you transform a GraphQLResolveInfo object i...
# orm-help
j
How do you transform a GraphQLResolveInfo object into something that matches the db schema when your app schema is not a subset of your db schema? we have introduced boundaries for fields in the app layer (example field: (name: {canView:Boolean! message:String! value: String})) the boundary obviously doesn't exist in the db schema as that doesn't make sense, but now the info object we receive in the resolver doesn't match the db so we can't select the field, how would we strip the boundary from the info object? we also have some cases where we generate the result of a query but it contains fields that should be fetched from the db, how do we get the selection of a field in the query?
a
are you talking about your server querying prisma, or your client querying your server?
j
both, the query that comes from the client matches the app schema but not the db schema, so on the server it has to be translated into something that matches the db schema before we can send it to prisma
a
j
It looks like i will be better off just rolling my own using the visit function and constructing a new query string based on that
it just seems like something that others would have encountered before and found a good solution to
a
doesn't that function give you the fields that are being requested, which you can then use to construct a query to send to prisma?