|
@@ -137,7 +137,9 @@ const upload = require('multer')({ dest: uploadPath })
|
|
},
|
|
},
|
|
async resolve(root, {login, password}, context, info){
|
|
async resolve(root, {login, password}, context, info){
|
|
const Savable = context.models.Savable
|
|
const Savable = context.models.Savable
|
|
|
|
+ if (!login || !password) return null;
|
|
const user = await Savable.m.User.findOne({login, password})
|
|
const user = await Savable.m.User.findOne({login, password})
|
|
|
|
+ console.log(user, {login, password})
|
|
if (!user)
|
|
if (!user)
|
|
return null;
|
|
return null;
|
|
|
|
|
|
@@ -149,6 +151,7 @@ const upload = require('multer')({ dest: uploadPath })
|
|
console.log(printSchema(schema))
|
|
console.log(printSchema(schema))
|
|
|
|
|
|
const app = express();
|
|
const app = express();
|
|
|
|
+ app.use(require('cors')())
|
|
app.use(express.static('public'));
|
|
app.use(express.static('public'));
|
|
app.use('/graphql', express_graphql(jwtGQLAnon({schema, createContext: getModels, graphiql: true, secret: jwtSecret})))
|
|
app.use('/graphql', express_graphql(jwtGQLAnon({schema, createContext: getModels, graphiql: true, secret: jwtSecret})))
|
|
|
|
|