iamclaytonray
06/19/2018, 3:04 PM/graphiql
not compatible with Prisma? I can execute queries and mutations fine (locally) but when I start adding filters, it just doesn’t work. When I hit the endpoint (`http://localhost:4466/service/stage`), where service and stage are my project’s service and stage, everything works perfectly but I have no idea where the data is going.iamclaytonray
06/19/2018, 3:09 PMiamclaytonray
06/19/2018, 3:15 PMiamclaytonray
06/19/2018, 3:20 PMnilan
06/20/2018, 8:29 AMthe database is a MySQL instance running in Dockeryou can connect Prisma (running in Docker) to any MySQL Database (running in Docker or somewhere else).
nilan
06/20/2018, 8:29 AMIsI don't understand this question.not compatible with Prisma?/graphiql
nilan
06/20/2018, 8:30 AMI can execute queries and mutations fine (locally) but when I start adding filters, it just doesn’t work.Can you elaborate what adding filters means here? I feel like I'm missing something 🙂
iamclaytonray
06/20/2018, 8:34 AMiamclaytonray
06/20/2018, 8:35 AMtype Post {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
published: Boolean!
title: String
body: String!
slug: String!
author: User
}
iamclaytonray
06/20/2018, 8:35 AMwhere
clause. Same thing goes for skip
, first
, last
, etc
{
posts(where: { published: false }) {
id
title
published
}
}
nilan
06/20/2018, 8:37 AMnilan
06/20/2018, 8:37 AMiamclaytonray
06/20/2018, 8:38 AMskip
, where
, etciamclaytonray
06/20/2018, 8:38 AMnilan
06/20/2018, 8:38 AMiamclaytonray
06/20/2018, 8:40 AMgraphql-tools
nilan
06/20/2018, 8:40 AMnilan
06/20/2018, 8:41 AMnilan
06/20/2018, 8:41 AMiamclaytonray
06/20/2018, 8:41 AMnilan
06/20/2018, 8:41 AMposts
query: https://github.com/iamclaytonray/nest-prisma/blob/master/src/schema.graphqliamclaytonray
06/20/2018, 8:42 AMschema.graphql
was an extra schema to only expose to clients or to use in conjunction with datamodel.graphql
(which is in root and has posts)nilan
06/20/2018, 8:48 AMschema.graphql
is your GraphQL Server schema. If you successfully run a posts
query, and your GraphQL Server uses the schema.graphql
in your repository, this means you are not running it against the GraphQL Server but against your Prisma API directly.iamclaytonray
06/20/2018, 8:54 AMiamclaytonray
06/20/2018, 8:54 AMnilan
06/20/2018, 8:54 AMiamclaytonray
06/20/2018, 8:55 AMwhere
, last
, first
, etciamclaytonray
06/20/2018, 8:55 AMnilan
06/20/2018, 8:56 AMiamclaytonray
06/20/2018, 8:57 AMiamclaytonray
06/20/2018, 8:58 AMnilan
06/20/2018, 9:00 AMiamclaytonray
06/20/2018, 9:00 AMnilan
06/20/2018, 9:00 AMiamclaytonray
06/20/2018, 9:00 AMiamclaytonray
06/20/2018, 9:01 AMiamclaytonray
06/20/2018, 9:01 AMnilan
06/20/2018, 9:01 AMiamclaytonray
06/20/2018, 9:01 AMnilan
06/20/2018, 9:01 AMiamclaytonray
06/20/2018, 9:02 AMnilan
06/20/2018, 9:05 AMiamclaytonray
06/20/2018, 9:23 AMdatamodel.graphql
, Prisma will generate mutations like createAuthentication(...)
and queries like authentications {}
. Obviously, I’d rather have a mutation called login()
and a query called me
. So, I put that in src/schema.graphql
and merge the type definitions into the schema. Everything else is within datamodel.graphql
. How would I properly do all of this? Would I add everything to a single GraphQL file (datamodel.graphql
), split it up like I have, or?iamclaytonray
06/20/2018, 9:23 AM<http://github.com/iamclaytonray/nest-prisma|github.com/iamclaytonray/nest-prisma>
nilan
06/20/2018, 9:24 AMnilan
06/20/2018, 9:24 AMschema.graphql
is completely free form. In your resolvers, you are implementing the mapping to your Prisma API.iamclaytonray
06/20/2018, 9:25 AMiamclaytonray
06/20/2018, 9:25 AMschema.graphql
?iamclaytonray
06/20/2018, 9:26 AMdatamodel.graphql
?nilan
06/20/2018, 9:26 AMiamclaytonray
06/20/2018, 9:27 AMiamclaytonray
06/20/2018, 9:27 AMschema.graphql
?nilan
06/20/2018, 9:27 AMnilan
06/20/2018, 9:27 AMiamclaytonray
06/20/2018, 9:28 AM