KJReactor
10/01/2019, 11:45 PMOR
is the where variable?KJReactor
10/01/2019, 11:46 PMLi Arolf Rey
10/02/2019, 12:19 AMprisma login --key {SESSION_KEY}
in prisma-cli? It still opens the browser for me, which makes my CI/CD build fail.Li Arolf Rey
10/02/2019, 12:19 AMJaume
10/02/2019, 9:45 AM@createdAt
and @updatedAt
but nothing more a part of this. A use case might to encrypt a password before update always like this implementation for mongoose:
UserSchema.pre("save", function(next) {
this.password = Bcrypt.hashSync(this.password, 10);
next();
});
thx in advance šKJReactor
10/02/2019, 11:48 AMOR
is not working for me even after copying the exact example from the docs:
const filteredPosts: Post[] = await prisma.posts({
where: {
OR: [
{
title_contains: 'graphql',
},
{
title_contains: 'prisma',
},
],
createdAt_gt: '2018',
createdAt_lt: '2020',
},
})
where
alone works with one condition but keep getting errors that OR
does not existSimskii
10/02/2019, 1:19 PMsapkra
10/02/2019, 4:45 PMJunsu Kim
10/03/2019, 7:48 AMKJReactor
10/03/2019, 5:46 PMinfo
resolver argument? Howtographql does not elaborate on thatdeactivateduser
10/03/2019, 9:10 PMMax Hodges
10/04/2019, 6:12 AMMax Hodges
10/04/2019, 6:12 AMBjarne Petersen
10/04/2019, 7:08 AMprisma import
which enables us to retain the legacy datas IDs, but they are not globally unique. Are there any tripwires we should be aware of in this regard?JamesJ
10/04/2019, 2:12 PMdeactivateduser
10/04/2019, 3:04 PMuser: {
connect: {
email: args.email
}
}
Is that not sufficient? I receive the following error: Field value.user of required type UserCreateOneInput! was not provided.
When I check the generated file I see:
input UserWhereUniqueInput {
id: ID
email: String
}
For me that means that I can either identify the user through his id or his email, or do I understand something, perhaps the error, wrong?nf.dominguez
10/04/2019, 3:07 PMnf.dominguez
10/04/2019, 3:07 PMdeactivateduser
10/04/2019, 3:10 PMconst item = await ctx.db.mutation.createItem(
{
user: {
connect: {
email: args.email
}
},
data: { title: args.title }
},
info
);
The type:
type Item {
id: ID! @id
title: String!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
user: User!
}
deactivateduser
10/04/2019, 3:17 PMPhakah
10/04/2019, 10:27 PMChris Mugnier
10/05/2019, 9:20 AMChris Mugnier
10/05/2019, 9:24 AMChris Mugnier
10/05/2019, 9:24 AMChris Mugnier
10/05/2019, 9:24 AMChris Mugnier
10/05/2019, 9:24 AMHeade
10/05/2019, 12:39 PMField "id" is not defined by type SubCategoryCreateOneWithoutItemsInput at value.subCategory
I am using Nextjs, Apollo, Graphql Yoga with Prisma and my schema is
type Mutation {
createItem(
title: String
description: String
price: Int
image: String
subCategory: SubCategoryInput
published: Boolean
): Item!
}
input SubCategoryInput {
id: ID!
name: String
body: String
image: String
items: [ItemInput]
category: CategoryInput
}
deactivateduser
10/05/2019, 3:07 PMconst user: IUser = await db.query.user(
{ where: { id: req.userId } },
'{ id, permissions, email, name }'
);
And I just recently moved my prisma import to from const { Prisma } = require('prisma-binding');
to import { Prisma } from 'prisma-binding';
Now I receive a type error, stating that the second argument to my user function (basically '{ id, permissions, email, name }'
) has the wrong type and is not of type [key: string]: any;
. The types are coming, for whatever reason, from graphql-bindings -- and are defined as the following:
export interface QueryMap {
[rootField: string]: (args?: {
[key: string]: any;
}, context?: {
[key: string]: any;
}, info?: GraphQLResolveInfo | string) => Promise<any>;
}
So I think the object I am providing is supposed to be the info object but I couldn't imagine that the syntax or the parameter order changes due to the switch to typescript... š¤deactivateduser
10/05/2019, 4:30 PMconst user: User = await prisma.user({ id: req.userId });
where User is: import { User } from './generated/prisma-client';
. It results in: Type 'UserNode' is missing the following properties from type 'User': then, catch, [Symbol.toStringTag], finally, $fragment
All the examples are working like that tho, see: https://codesandbox.io/s/x7o68w0pzp?module=%2Fsrc%2Freading-data%2Flists-and-single-objects.ts Line 14deactivateduser
10/05/2019, 4:35 PM