GraphQL Info Transformer
This is a proof of concept to transform GraphQL's info
into an object that can be consumed by Prisma's PhotonJS (API schema and DB schema must match). Can be useful when migrating from Prisma v1 to v2 (i.e. from Prisma Binding to PhotonJS).
{ return photonusers})
Based on this article and some GraphQL-related projects.
Installation
npm install graphql-info-transformeryarn add graphql-info-transformer
Prisma2 example
In the example
folder:
- Setup DB
yarn prisma2 devyarn seed
- Test query
Run the project with yarn start
and open the Playground to try the following query:
query { users { id name email posts(where: { title: { contains: "prisma" } }, orderBy: { title: asc }) { id content title } }}
It should show only 2 of the 3 posts in the seed.