Skip to content

Commit

Permalink
1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fi1osof committed Apr 7, 2020
1 parent 12a92ad commit 1eb0c35
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
4 changes: 4 additions & 0 deletions changelog.md
@@ -1,3 +1,7 @@
1.4.2
===============================
- Fix modifyArgs

1.4.1
===============================
- Fix users query search
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "@prisma-cms/user-module",
"description": "User module for @prisma-cms/server",
"version": "1.4.1",
"version": "1.4.2",
"main": "src/",
"files": [
"src"
Expand Down Expand Up @@ -33,12 +33,12 @@
"@prisma-cms/sms-module": "latest",
"@prisma-cms/user-module": "latest",
"expect": "^23.6.0",
"graphql": "*",
"graphql": "^14.0.2",
"mocha": "^5.2.0",
"nodemon": "latest"
},
"resolutions": {
"graphql": "*"
"graphql": "^14.0.2"
},
"author": "Fi1osof",
"license": "MIT",
Expand Down
17 changes: 12 additions & 5 deletions src/modules/index.mjs
@@ -1,4 +1,7 @@

import {
modifyArgs as modifyArgsDefault,
} from "@prisma-cms/server";

import Processor from "@prisma-cms/prisma-processor";

Expand Down Expand Up @@ -260,7 +263,6 @@ export class UserProcessor extends Processor {
}



if (!this.hasErrors()) {

password = await this.createPassword(password);
Expand Down Expand Up @@ -1209,16 +1211,21 @@ export default class PrismaUserModule extends PrismaModule {
// },
});

const {
modifyArgs,
} = ctx;
this.modifyArgs(source, args, ctx, info, this.injectWhereSearch);

modifyArgs(source, args, ctx, info, this.injectWhereSearch);

// console.log('args', JSON.stringify(args, true, 2));

}

modifyArgs(source, args, ctx, info, modifier) {

const {
modifyArgs = modifyArgsDefault,
} = ctx;

return modifyArgs(source, args, ctx, info, modifier);
}

usersConnection(source, args, ctx, info) {

Expand Down
6 changes: 3 additions & 3 deletions src/modules/schema/database/user.graphql
Expand Up @@ -30,10 +30,10 @@ type User{
Groups: [UserGroup!]! @relation(name: "UserGroups")

CreatedUsers: [User!]! @relation(name: "UserCreatedBy", onDelete: SET_NULL)
CreatedBy: User @relation(name: "UserCreatedBy", onDelete: SET_NULL)
CreatedBy: User @relation(name: "UserCreatedBy")

LogedIns: [LogedIn!]! @relation (name: "UserLogedIn")
Files: [File!]! @relation(name: "UserFiles")
LogedIns: [LogedIn!]! @relation (name: "UserLogedIn" onDelete: CASCADE)
Files: [File!]! @relation(name: "UserFiles" onDelete: SET_NULL)

"""Hide profile"""
hidden: Boolean @default(value: false)
Expand Down
4 changes: 2 additions & 2 deletions src/server/index.mjs
@@ -1,6 +1,6 @@

import startServer, {
modifyArgs,
// modifyArgs,
} from "@prisma-cms/server";

import PrismaUserModule from "../";
Expand All @@ -16,6 +16,6 @@ startServer({
typeDefs: 'src/schema/generated/api.graphql',
resolvers,
contextOptions: {
modifyArgs,
// modifyArgs,
},
});

0 comments on commit 1eb0c35

Please sign in to comment.