Skip to content

Commit

Permalink
style(Prettier): Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
nodkz committed Aug 7, 2017
1 parent 9baa40f commit 5e08527
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/resolvers/removeById.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default function removeById(
kind: 'mutation',
description:
'Remove one document: ' +
'1) Retrieve one document and remove with hooks via findByIdAndRemove. ' +
'2) Return removed document.',
'1) Retrieve one document and remove with hooks via findByIdAndRemove. ' +
'2) Return removed document.',
type: outputType,
args: {
_id: {
Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/removeMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export default function removeMany(
kind: 'mutation',
description:
'Remove many documents without returning them: ' +
'Use Query.remove mongoose method. ' +
'Do not apply mongoose defaults, setters, hooks and validation. ',
'Use Query.remove mongoose method. ' +
'Do not apply mongoose defaults, setters, hooks and validation. ',
type: outputType,
args: {
...filterHelperArgs(typeComposer, model, {
Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/removeOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default function removeOne(
kind: 'mutation',
description:
'Remove one document: ' +
'1) Remove with hooks via findOneAndRemove. ' +
'2) Return removed document.',
'1) Remove with hooks via findOneAndRemove. ' +
'2) Return removed document.',
type: outputType,
args: {
...filterHelperArgs(typeComposer, model, {
Expand Down
8 changes: 4 additions & 4 deletions src/resolvers/updateById.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export default function updateById(
kind: 'mutation',
description:
'Update one document: ' +
'1) Retrieve one document by findById. ' +
'2) Apply updates to mongoose document. ' +
'3) Mongoose applies defaults, setters, hooks and validation. ' +
'4) And save it.',
'1) Retrieve one document by findById. ' +
'2) Apply updates to mongoose document. ' +
'3) Mongoose applies defaults, setters, hooks and validation. ' +
'4) And save it.',
type: outputType,
args: {
...recordHelperArgs(typeComposer, {
Expand Down
4 changes: 2 additions & 2 deletions src/resolvers/updateMany.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default function updateMany(
kind: 'mutation',
description:
'Update many documents without returning them: ' +
'Use Query.update mongoose method. ' +
'Do not apply mongoose defaults, setters, hooks and validation. ',
'Use Query.update mongoose method. ' +
'Do not apply mongoose defaults, setters, hooks and validation. ',
type: outputType,
args: {
...recordHelperArgs(typeComposer, {
Expand Down
8 changes: 4 additions & 4 deletions src/resolvers/updateOne.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export default function updateOne(
kind: 'mutation',
description:
'Update one document: ' +
'1) Retrieve one document via findOne. ' +
'2) Apply updates to mongoose document. ' +
'3) Mongoose applies defaults, setters, hooks and validation. ' +
'4) And save it.',
'1) Retrieve one document via findOne. ' +
'2) Apply updates to mongoose document. ' +
'3) Mongoose applies defaults, setters, hooks and validation. ' +
'4) And save it.',
type: outputType,
args: {
...recordHelperArgs(typeComposer, {
Expand Down
6 changes: 3 additions & 3 deletions src/types/mongoid.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const GraphQLMongoID = new GraphQLScalarType({
name: 'MongoID',
description:
'The `ID` scalar type represents a unique MongoDB identifier in collection. ' +
'MongoDB by default use 12-byte ObjectId value ' +
'(https://docs.mongodb.com/manual/reference/bson-types/#objectid). ' +
'But MongoDB also may accepts string or integer as correct values for _id field.',
'MongoDB by default use 12-byte ObjectId value ' +
'(https://docs.mongodb.com/manual/reference/bson-types/#objectid). ' +
'But MongoDB also may accepts string or integer as correct values for _id field.',
serialize: String,
parseValue: String,
parseLiteral(ast) {
Expand Down
9 changes: 4 additions & 5 deletions src/utils/getIndexesFromModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@ function isSpecificIndex(idx) {
return hasSpecialIndex;
}

/**
/*
* Get mongoose model, and return array of fields with indexes.
* MongooseModel -> [ { _id: 1 }, { name: 1, surname: -1 } ]
**/
*/
export function getIndexesFromModel(
mongooseModel: MongooseModelT,
opts: getIndexesFromModelOpts = {}
): ObjectMap[] {
const extractCompound = opts.extractCompound === undefined ? true : Boolean(opts.extractCompound);
const skipSpecificIndexes = opts.skipSpecificIndexes === undefined
? true
: Boolean(opts.skipSpecificIndexes);
const skipSpecificIndexes =
opts.skipSpecificIndexes === undefined ? true : Boolean(opts.skipSpecificIndexes);

const indexedFields = [];

Expand Down

0 comments on commit 5e08527

Please sign in to comment.