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

nexus-prisma

Package Overview
Dependencies
Maintainers
1
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nexus-prisma - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1-next.1

14

dist/builder.js

@@ -97,3 +97,3 @@ "use strict";

},
computedInputs: {}
computedInputs: {},
};

@@ -273,2 +273,9 @@ class SchemaBuilder {

this.assertFilteringOrOrderingArgNameExists(typeName, field.outputType.type, publisherConfig.alias, publisherConfig, stage);
const mapping = this.dmmf.getMapping(typeName);
const idField = this.dmmf
.getModelOrThrow(typeName)
.fields.find(f => f.isId);
if (!idField) {
throw new Error(`Your Prisma Model ${typeName} does not have an @id field. It's required for nexus-prisma to work.`);
}
const fieldConfig = this.buildFieldConfig({

@@ -281,4 +288,5 @@ field,

const photon = this.getPhoton(ctx);
const mapping = this.dmmf.getMapping(typeName);
return photon[mapping.plural]['findOne']({ where: { id: root.id } })[field.name](args);
return photon[mapping.plural]['findOne']({
where: { [idField.name]: root[idField.name] },
})[field.name](args);
}

@@ -285,0 +293,0 @@ : undefined,

{
"name": "nexus-prisma",
"version": "0.8.0",
"version": "0.8.1-next.1",
"main": "dist/index.js",

@@ -36,4 +36,7 @@ "types": "dist/index.d.ts",

"devDependencies": {
"@prisma/client": "^2.0.0-preview020",
"@prisma/cli": "^0.1.31",
"@prisma/client": "^2.0.0-preview020.3",
"@prisma/fetch-engine": "^0.3.52",
"@prisma/lift": "^0.3.384",
"@prisma/sdk": "^0.0.176",
"@types/fs-extra": "^8.0.0",

@@ -43,6 +46,10 @@ "@types/jest": "^24.9.0",

"@types/pluralize": "^0.0.29",
"@types/rimraf": "^2.0.3",
"@types/tmp": "^0.1.0",
"doctoc": "^1.4.0",
"dripip": "^0.5.0",
"get-port": "^5.1.1",
"graphql": "^14.5.4",
"graphql-request": "^1.8.2",
"graphql-yoga": "^1.18.3",
"jest": "^24.9.0",

@@ -52,3 +59,5 @@ "jest-watch-typeahead": "^0.4.0",

"prettier": "^1.17.1",
"prisma2": "^2.0.0-preview020",
"prisma2": "^2.0.0-preview020.3",
"react": "^16.12.0",
"rimraf": "^3.0.1",
"strip-ansi": "^6.0.0",

@@ -55,0 +64,0 @@ "tmp": "^0.1.0",

@@ -194,3 +194,3 @@ import * as Nexus from 'nexus'

},
computedInputs: {}
computedInputs: {},
}

@@ -459,2 +459,13 @@

)
const mapping = this.dmmf.getMapping(typeName)
const idField = this.dmmf
.getModelOrThrow(typeName)
.fields.find(f => f.isId)
if (!idField) {
throw new Error(
`Your Prisma Model ${typeName} does not have an @id field. It's required for nexus-prisma to work.`,
)
}
const fieldConfig = this.buildFieldConfig({

@@ -468,5 +479,6 @@ field,

const photon = this.getPhoton(ctx)
const mapping = this.dmmf.getMapping(typeName)
return photon[mapping.plural!]
['findOne']({ where: { id: root.id } })
['findOne']({
where: { [idField.name]: root[idField.name] },
})
[field.name](args)

@@ -473,0 +485,0 @@ }

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