Marco Tedone
06/29/2020, 10:59 PMprojects:
prisma:
schema: '/src/generated/prisma.graphql'
And my datamodel is as follows:
type User {
id: ID! @id
name: String!
email: String! @unique
posts: [Post!]! @relation(link: INLINE)
comments: [Comment!]! @relation(link: INLINE)
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
type Post {
id: ID! @id
title: String!
body: String!
published: Boolean!
author: User!
comments: [Comment!]! @relation(link: INLINE)
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
type Comment {
id: ID! @id
text: String!
author: User!
post: Post!
}
Using Docker Compose everyting works fine, the UI at localhost:4466 shows me all the mutations, queries and subscriptions. But I'd like graphql to generate the prisma.graphql which I can pass to the Prisma object in Node here under the /generated folder.:
import { Prisma } from 'prisma-binding';
const prisma = new Prisma({
typeDefs: './generated/prisma.graphql',
endpoint: 'localhost:4466',
});
Any idea as to why it's not working?Philipp Rajah Moura Srivastava
06/29/2020, 11:01 PMMarco Tedone
06/29/2020, 11:04 PM{
"name": "graphql-basics",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon src/index.js --ext js,graphql --exec babel-node",
"get-schema": "graphql get-schema -p prisma",
"graphql:coverage": "graphql coverage",
"graphql:validate": "graphql validate",
"graphql:diff": "graphql diff",
"graphql:similar": "graphql similar"
},
"author": "",
"license": "ISC",
"dependencies": {
"graphql-yoga": "^1.18.3",
"prisma-binding": "^2.3.16",
"uuid": "^8.2.0"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
"@babel/core": "^7.10.3",
"@babel/node": "^7.10.3",
"@babel/preset-env": "^7.10.3",
"nodemon": "^1.17.5",
"graphql-cli": "4.0.0",
"@graphql-cli/coverage": "2.1.0",
"@graphql-cli/validate": "2.1.0",
"@graphql-cli/diff": "2.1.0",
"@graphql-cli/similar": "2.1.0"
}
}Philipp Rajah Moura Srivastava
06/29/2020, 11:16 PMMarco Tedone
06/29/2020, 11:18 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:20 PMMarco Tedone
06/29/2020, 11:21 PMtype Query {
users x 0
posts x 0
comments x 0
user x 0
post x 0
comment x 0
usersConnection x 0
postsConnection x 0
commentsConnection x 0
node x 0
}
type User {
id x 0
name x 0
email x 0
posts x 0
comments x 0
createdAt x 0
updatedAt x 0
}
interface Node {
id x 0
}
type Post {
id x 0
title x 0
body x 0
published x 0
author x 0
comments x 0
createdAt x 0
updatedAt x 0
}
type Comment {
id x 0
text x 0
author x 0
post x 0
}
type UserConnection {
pageInfo x 0
edges x 0
aggregate x 0
}
type PageInfo {
hasNextPage x 0
hasPreviousPage x 0
startCursor x 0
endCursor x 0
}
type UserEdge {
node x 0
cursor x 0
}
type AggregateUser {
count x 0
}
type PostConnection {
pageInfo x 0
edges x 0
aggregate x 0
}
type PostEdge {
node x 0
cursor x 0
}
type AggregatePost {
count x 0
}
type CommentConnection {
pageInfo x 0
edges x 0
aggregate x 0
}
type CommentEdge {
node x 0
cursor x 0
}
type AggregateComment {
count x 0
}
type Mutation {
createUser x 0
createPost x 0
createComment x 0
updateUser x 0
updatePost x 0
updateComment x 0
deleteUser x 0
deletePost x 0
deleteComment x 0
upsertUser x 0
upsertPost x 0
upsertComment x 0
updateManyUsers x 0
updateManyPosts x 0
updateManyComments x 0
deleteManyUsers x 0
deleteManyPosts x 0
deleteManyComments x 0
}
type BatchPayload {
count x 0
}
type Subscription {
user x 0
post x 0
comment x 0
}
type UserSubscriptionPayload {
mutation x 0
node x 0
updatedFields x 0
previousValues x 0
}
type UserPreviousValues {
id x 0
name x 0
email x 0
createdAt x 0
updatedAt x 0
}
type PostSubscriptionPayload {
mutation x 0
node x 0
updatedFields x 0
previousValues x 0
}
type PostPreviousValues {
id x 0
title x 0
body x 0
published x 0
createdAt x 0
updatedAt x 0
}
type CommentSubscriptionPayload {
mutation x 0
node x 0
updatedFields x 0
previousValues x 0
}
type CommentPreviousValues {
id x 0
text x 0
}
Can I just copy this content into the prisma.graphql file you think?Philipp Rajah Moura Srivastava
06/29/2020, 11:22 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:22 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:23 PMMarco Tedone
06/29/2020, 11:24 PMMarco Tedone
06/29/2020, 11:25 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:26 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:26 PMMarco Tedone
06/29/2020, 11:28 PMMarco Tedone
06/29/2020, 11:29 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:30 PMMarco Tedone
06/29/2020, 11:32 PMdefault to stage default to server local 491ms
Service is already up to date.Marco Tedone
06/29/2020, 11:32 PMMarco Tedone
06/29/2020, 11:47 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:48 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:48 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:48 PMMarco Tedone
06/29/2020, 11:49 PMendpoint: <http://localhost:4466>
datamodel: ./prisma/datamodel.graphql
databaseType: document
generate:
- generator: graphql-schema
output: ./src/generated/prisma.graphql
hooks:
post-deploy:
- prisma generatePhilipp Rajah Moura Srivastava
06/29/2020, 11:50 PMMarco Tedone
06/29/2020, 11:51 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:51 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:52 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:52 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:52 PMMarco Tedone
06/29/2020, 11:52 PMMarco Tedone
06/29/2020, 11:53 PMMarco Tedone
06/29/2020, 11:53 PMMarco Tedone
06/29/2020, 11:53 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:53 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:53 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:53 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:54 PMMarco Tedone
06/29/2020, 11:54 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:55 PMMarco Tedone
06/29/2020, 11:58 PMMarco Tedone
06/29/2020, 11:58 PMMarco Tedone
06/29/2020, 11:59 PMPhilipp Rajah Moura Srivastava
06/29/2020, 11:59 PMMarco Tedone
06/30/2020, 12:02 AMMarco Tedone
06/30/2020, 12:04 AMMarco Tedone
06/30/2020, 12:04 AMPhilipp Rajah Moura Srivastava
06/30/2020, 12:05 AMPhilipp Rajah Moura Srivastava
06/30/2020, 12:05 AM