Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-prisma-nestjs-graphql

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-prisma-nestjs-graphql - npm Package Compare versions

Comparing version 0.0.6 to 0.1.0

25

dist/index.js

@@ -49,3 +49,5 @@ "use strict";

const args = (name, type) => {
return `@Args({ name: '${name}', nullable: true }) ${name}: ${type}OrderByInput,`;
return `@Args({ nullable: true }) ${name}: FindMany${type
.replace('[', '')
.replace(']', '')}Args`;
};

@@ -104,8 +106,9 @@ module.exports = {

const multiImports = openResolvers
.filter(i => -1 !== i.type.search('['))
.filter(i => -1 !== i.type.indexOf('['))
.map(r => r.type.replace('[', '').replace(']', ''));
const importFix = fixer.insertTextBefore(decorator, `import {
${imports.join(', ')},
${multiImports.map(i => i + 'WhereInput').join(', ')},
${multiImports.map(i => i + 'OrderByInput').join(', ')},
${multiImports
.map(i => 'FindMany' + i + 'Args, ')
.join('')}
} from '@prisma/client/nestjs-graphql'

@@ -119,11 +122,5 @@ `);

@ResolveField(() => ${r.type}, {
name: '${r.name}',
${isToManyRelation ? '' : '\n nullable: true,'}
name: '${r.name}',${isToManyRelation ? '' : '\n nullable: true, \n'}
})
${r.name}(@Parent() ${(0, camelcase_1.default)(decoratorName)}: ${decoratorName}, ${isToManyRelation
? args('where', r.type) +
', \n' +
args('orderBy', r.type)
: ''}
) {
${r.name}(@Parent() ${(0, camelcase_1.default)(decoratorName)}: ${decoratorName}, ${isToManyRelation ? args('args', r.type) + ', ' : ''}) {
return this.${(0, camelcase_1.default)(decoratorName)}Service

@@ -133,5 +130,5 @@ .findOne({

})
.${r.name}({ where });
.${r.name}(${isToManyRelation ? 'args' : ''});
}
`;
`;
})

@@ -138,0 +135,0 @@ .join('');

{
"name": "eslint-plugin-prisma-nestjs-graphql",
"version": "0.0.6",
"version": "0.1.0",
"description": "eslint plugin for prisma & nestjs & graphql setups to not forget resolvers etc.",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc