noahdavis
07/03/2018, 2:23 AMGorodov Maksim
07/03/2018, 5:17 AMPerson
, but after deleting I get null
in data. Why?Gorodov Maksim
07/03/2018, 5:17 AMGorodov Maksim
07/03/2018, 5:17 AMpersonDeleted: {
subscribe: (parent, args, context, info) => {
return context.prisma.subscription.person({ where: { mutation_in: ['DELETED'] } }, info);
},
},
personDeleted: PersonSubscriptionPayload!
Gorodov Maksim
07/03/2018, 5:18 AMPerson
but they work fineGorodov Maksim
07/03/2018, 5:19 AMexport const DELETE_PERSON_SUBSCRIPTION = gql`
subscription personDeleted {
personDeleted {
node {
id
name
position
description
karma
author {
nickname
}
}
}
}
`;
(same as creating or deleting, just another name (personCreated
, personUpdated
, personDeleted
))Gorodov Maksim
07/03/2018, 5:37 AMexport const DELETE_PERSON_SUBSCRIPTION = gql`
subscription personDeleted {
personDeleted {
previousValues {
id
}
}
}
`;
Seppe Snoeck
07/03/2018, 7:56 AMcodepunkt
07/03/2018, 8:12 AMhalborg
07/03/2018, 8:33 AMArnab
07/03/2018, 9:14 AM2018-07-03 09:10:47.389 UTC [58] LOG: execute <unnamed>: SELECT * FROM "default$default"."Department" AS "Alias" WHERE TRUE ORDER BY "Alias"."id" asc
2018-07-03 09:10:54.081 UTC [58] LOG: execute <unnamed>: SELECT * FROM "default$default"."Department" AS "Alias" WHERE TRUE ORDER BY "Alias"."id" asc
These are the GraphQL queries:
query {
departments {
description
name
}
}
query {
departments {
name
}
}
Shouldn't these queries be selective about what fields are queried in the database instead of just doing a wildcard on both? Maybe there is some kind of lower threshold (say less than 3 cols in the table) where prisma just does wildcard?codepunkt
07/03/2018, 9:24 AMtype User {
id: ID! @unique
email: String! @unique
name: String!
roles: [UserRole!] @default(value: ["User"])
}
enum UserRole {
Admin
User
}
When i create a new user without explicitly defining roles, roles winds up being empty.
What is the correct syntax for this?codepunkt
07/03/2018, 9:33 AMMoritz
07/03/2018, 10:27 AMdmce
07/03/2018, 11:13 AMconst server = new GraphQLServer({
typeDefs: JUST USE GENERATED/PRISMA.GRAPHQL?,
resolvers,
mocks: process.env.MOCKS === 'true' ? mocks : null,
context: req => ({
req,
prisma: new Prisma({
typeDefs: './src/generated/prisma.graphql',
endpoint: process.env.PRISMA_ENDPOINT,
debug: true,
}),
}),
});
Nick
07/03/2018, 12:39 PMprisma deploy
don't generate a new schema really annoying got stuck on chapter Authentication(node.js backend). It ended up with me copying the entire generated schema from the finish app https://github.com/howtographql/graphql-js/blob/master/src/generated/prisma.graphql
Doing this tutorial, all of the issues I had so far has to do with prisma packageJim
07/03/2018, 1:02 PMnilan
07/03/2018, 1:05 PMNick
07/03/2018, 1:07 PMnilan
07/03/2018, 1:09 PMJim
07/03/2018, 1:32 PMNick
07/03/2018, 1:42 PMDarryl
07/03/2018, 2:59 PMDarryl
07/03/2018, 3:00 PMDarryl
07/03/2018, 3:02 PMmutation CreateRecipe {
createRecipe(
name: "..."
instructions: [
"Step 1"
"Step 2"
"Step 3"
]
ingredients: [
{
name: "Rolled Oats"
quantity: 1
}
{
name: "Oat Milk"
quantity: 3
}
]
) {
id
name
}
}
Once that’s fired, it’d grab query for those ingredients, get their nutritional information, multiply it by the quantity (this is the part I’m stuck on with relations), and then add a nutrition object to the stored recipe (containing the totals).Darryl
07/03/2018, 3:07 PMGorodov Maksim
07/03/2018, 3:39 PM.graphqlconfig.yml
doesn't see variables in .env?
https://www.prisma.io/forum/t/set-up-environment-with-env/3844artindaniel
07/03/2018, 4:39 PMcheckmatez
07/03/2018, 5:59 PMcheckmatez
07/03/2018, 6:02 PMexport interface Options {
transforms?: Transform[];
context?: Context;
}
I wonder what transforms actually do?