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

eslint plugin for prisma & nestjs & graphql setups to not forget resolvers etc.

  • 0.0.3
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslint-plugin-prisma-nestjs-graphql

Goal of the plugin (p):

  • I always forgot some field-resolvers in my graphql resolver files.
  • I wrote myself a little eslint p to check the prisma.schema entities' relations against the field resolvers in my files.
  • Additionally, the p can auto-fix missing resolvers (means it inserts them (quite) the right way).
  • Together with lint --fix it can auto-generate all your (basic) field resolvers.
  • So the overall goal is to save you and me from error-prone, manual field resolver coding.
  • This p will (atm) not check if you implemented all models of your prisma file, just if there is a model resolver => it will check if the field resolvers are there

How to use the p:

  • It needs you to also use https://www.npmjs.com/package/prisma-json-schema-generator as generator for your prisma setup.
  • The p will look for a file called prisma/generated/json-schema.json which should be generated by the prisma-json-schema-generator
  • Therefore the generator should look somewhat like that:
...
generator jsonSchema {
  provider = "prisma-json-schema-generator"
  output   = "./generated/"
}
...
  • Your resolver files should reside in a folder

Known issues

  • Imports are added automatically (and naively) => if an import in a resolver file already exists before linting and the same one gets added by the linter => it will exist twice => error
    • Just delete the second (generated) import.
  • Paths are inflexible
    • Will hopefully be adressed in the future

npm package: https://www.npmjs.com/package/eslint-plugin-prisma-nestjs-graphql prisma-nestjs-graphql resource generator: LINK

FAQs

Package last updated on 18 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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