I get the following error when I try to upsert an item.
Error:
Invalid `prisma.organizations.upsert()` invocation in
/Users/manuelruck/Jobs/openData/oparlPrisma/src/import/index.ts:79:26
Error in query graph construction: InputError("The `set` argument was not provided for field `post` on `Organization`")
at PrismaClientFetcher.request (/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/index.js:90:17)
at process._tickCallback (internal/process/next_tick.js:68:7)

it's just an array of strings.
and the code intelligence shows me only the set property

const organizationPrepared = {
...organization,
body: undefined,
'STERNBERG:gruppierung': undefined,
'STERNBERG:sortierung': undefined,
membership: undefined,
meeting: undefined,
location: undefined,
keyword: undefined,
subOrganizationOf: undefined,
post: {
set: organization.post,
},
};
return prisma.organization
.upsert({
create: organizationPrepared,
update: organizationPrepared,
where: { id: organizationPrepared.id },
})
.catch(console.log);
});
model Organization {
id String @id
type String
// Body Body
name String?
// membership Membership[]
// meeting Meeting[]
// consultation any
shortName String?
post String[]
subOrganizationOf Organization?
organizationType String?
classification String?
startDate String?
endDate String?
website String?
// # location any
// externalBody Body
license String?
keyword String[]
created String?
modified String?
web String?
deleted Boolean?
}
repo (branch: issue/set-error): https://github.com/ManAnRuck/oparl-prisma/tree/issue/set-error
Hello @ManAnRuck
Thanks for the reproduction repository. I tried your reproduction and I was able to reproduce this with preview023 but I wasn't able to reproduce this with preview024 which was released yesterday. So can you please try this again with the latest version?
@pantharshit00 thank you for checking :)
I now update the Prisma packages and get the same issue :'(

i also removed node_modules directory and removed my migrations and reinitialised the project
Sorry for the delay here @ManAnRuck
I tried this again and was still unsuccessful in reproducing this problem.
Can you please try the current alpha version(npm install -g prisma2@alpha) and see if that fixes this issue for you?
If this is still persistent, please paste enable debug out by executing export DEBUG=*.After that run your script to reproduce the problem. That can help us the cause of this exception.
still not works :/
Versions
鈹溾攢 @prisma/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @types/[email protected]
鈹溾攢 @wry/[email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹斺攢 [email protected]
Debug
prisma-client { engineConfig:
prisma-client { cwd: '/Users/manuelruck/Jobs/openData/oparlPrisma/prisma',
prisma-client debug: false,
prisma-client datamodelPath:
prisma-client '/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/schema.prisma',
prisma-client prismaPath: undefined,
prisma-client datasources: [],
prisma-client generator:
prisma-client { name: 'client',
prisma-client provider: 'prisma-client-js',
prisma-client output:
prisma-client '/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client',
prisma-client binaryTargets: [],
prisma-client config: {} },
prisma-client showColors: false,
prisma-client logLevel: undefined,
prisma-client logQueries: undefined,
prisma-client env: {},
prisma-client flags: [] } } +0ms
express:application set "x-powered-by" to true +0ms
express:application set "etag" to 'weak' +1ms
express:application set "etag fn" to [Function: generateETag] +1ms
express:application set "env" to 'development' +0ms
express:application set "query parser" to 'extended' +0ms
express:application set "query parser fn" to [Function: parseExtendedQueryString] +0ms
express:application set "subdomain offset" to 2 +0ms
express:application set "trust proxy" to false +1ms
express:application set "trust proxy fn" to [Function: trustNone] +0ms
express:application booting in development mode +0ms
express:application set "view" to [Function: View] +0ms
express:application set "views" to '/Users/manuelruck/Jobs/openData/oparlPrisma/views' +0ms
express:application set "jsonp callback name" to 'callback' +0ms
express:router use '/' query +2ms
express:router:layer new '/' +0ms
express:router use '/' expressInit +2ms
express:router:layer new '/' +36ms
express:router use '/' corsMiddleware +1ms
express:router:layer new '/' +0ms
express:router:route new '/' +0ms
express:router:layer new '/' +0ms
express:router:route post '/' +1ms
express:router:layer new '/' +0ms
express:router:route new '/' +0ms
express:router:layer new '/' +0ms
express:router:route post '/' +0ms
express:router:layer new '/' +0ms
express:router:route new '/' +0ms
express:router:layer new '/' +0ms
express:router:route post '/' +0ms
express:router:layer new '/' +0ms
express:router:route new '/' +1ms
express:router:layer new '/' +69ms
express:router:route get '/' +0ms
express:router:layer new '/' +0ms
prisma-client { engineConfig:
prisma-client { cwd: '/Users/manuelruck/Jobs/openData/oparlPrisma/prisma',
prisma-client debug: false,
prisma-client datamodelPath:
prisma-client '/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/schema.prisma',
prisma-client prismaPath: undefined,
prisma-client datasources: [],
prisma-client generator:
prisma-client { name: 'client',
prisma-client provider: 'prisma-client-js',
prisma-client output:
prisma-client '/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client',
prisma-client binaryTargets: [],
prisma-client config: {} },
prisma-client showColors: false,
prisma-client logLevel: undefined,
prisma-client logQueries: undefined,
prisma-client env: {},
prisma-client flags: [] } } +524ms
getos { platform: 'darwin', libssl: undefined } +0ms
getos { platform: 'darwin', libssl: undefined } +1ms
follow-redirects options { protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: '/rim4883/webservice/oparl/v1.1/body/1',
method: 'GET',
headers:
{ Accept: 'application/json, text/plain, */*',
'User-Agent': 'axios/0.19.2' },
agent: undefined,
agents: { http: undefined, https: undefined },
auth: undefined,
hostname: 'sdnetrim.kdvz-frechen.de',
port: null,
nativeProtocols:
{ 'http:':
{ _connectionListener: [Function: connectionListener],
METHODS: [Array],
STATUS_CODES: [Object],
Agent: [Function],
ClientRequest: [Function],
IncomingMessage: [Function],
OutgoingMessage: [Function],
Server: [Function],
ServerResponse: [Function],
createServer: [Function: createServer],
get: [Function: get],
request: [Function: request],
maxHeaderSize: [Getter],
globalAgent: [Getter/Setter] },
'https:':
{ Agent: [Function],
globalAgent: [Agent],
Server: [Function],
createServer: [Function: createServer],
get: [Function: get],
request: [Function: request] } } } +0ms
follow-redirects options { protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: '/rim4883/webservice/oparl/v1.1/body/1/organization',
method: 'GET',
headers:
{ Accept: 'application/json, text/plain, */*',
'User-Agent': 'axios/0.19.2' },
agent: undefined,
agents: { http: undefined, https: undefined },
auth: undefined,
hostname: 'sdnetrim.kdvz-frechen.de',
port: null,
nativeProtocols:
{ 'http:':
{ _connectionListener: [Function: connectionListener],
METHODS: [Array],
STATUS_CODES: [Object],
Agent: [Function],
ClientRequest: [Function],
IncomingMessage: [Function],
OutgoingMessage: [Function],
Server: [Function],
ServerResponse: [Function],
createServer: [Function: createServer],
get: [Function: get],
request: [Function: request],
maxHeaderSize: [Getter],
globalAgent: [Getter/Setter] },
'https:':
{ Agent: [Function],
globalAgent: [Agent],
Server: [Function],
createServer: [Function: createServer],
get: [Function: get],
request: [Function: request] } } } +265ms
prisma-client Prisma Client call: +1s
prisma-client prisma.organization.upsert({
prisma-client create: {
prisma-client id: 'https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/organization/3-1',
prisma-client type: 'https://schema.oparl.org/1.1/Organization',
prisma-client body: undefined,
prisma-client name: 'B眉rgerservice und Interne Dienste',
prisma-client organizationType: 'Dienststellen',
prisma-client startDate: '2004-01-28',
prisma-client created: '2011-02-21T08:59:44+01:00',
prisma-client modified: '2015-04-14T00:00:00+02:00',
prisma-client 'STERNBERG:gruppierung': undefined,
prisma-client 'STERNBERG:sortierung': undefined,
prisma-client membership: undefined,
prisma-client meeting: undefined,
prisma-client location: undefined,
prisma-client keyword: undefined,
prisma-client subOrganizationOf: undefined,
prisma-client post: {
prisma-client set: undefined
prisma-client }
prisma-client },
prisma-client update: {
prisma-client id: 'https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/organization/3-1',
prisma-client type: 'https://schema.oparl.org/1.1/Organization',
prisma-client body: undefined,
prisma-client name: 'B眉rgerservice und Interne Dienste',
prisma-client organizationType: 'Dienststellen',
prisma-client startDate: '2004-01-28',
prisma-client created: '2011-02-21T08:59:44+01:00',
prisma-client modified: '2015-04-14T00:00:00+02:00',
prisma-client 'STERNBERG:gruppierung': undefined,
prisma-client 'STERNBERG:sortierung': undefined,
prisma-client membership: undefined,
prisma-client meeting: undefined,
prisma-client location: undefined,
prisma-client keyword: undefined,
prisma-client subOrganizationOf: undefined,
prisma-client post: {
prisma-client set: undefined
prisma-client }
prisma-client },
prisma-client where: {
prisma-client id: 'https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/organization/3-1'
prisma-client }
prisma-client }) +2ms
prisma-client Generated request: +34ms
prisma-client mutation {
prisma-client upsertOneOrganization(
prisma-client create: {
prisma-client id: "https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/organization/3-1"
prisma-client type: "https://schema.oparl.org/1.1/Organization"
prisma-client name: "B眉rgerservice und Interne Dienste"
prisma-client organizationType: "Dienststellen"
prisma-client startDate: "2004-01-28"
prisma-client created: "2011-02-21T08:59:44+01:00"
prisma-client modified: "2015-04-14T00:00:00+02:00"
prisma-client post: {
prisma-client
prisma-client }
prisma-client }
prisma-client update: {
prisma-client id: "https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/organization/3-1"
prisma-client type: "https://schema.oparl.org/1.1/Organization"
prisma-client name: "B眉rgerservice und Interne Dienste"
prisma-client organizationType: "Dienststellen"
prisma-client startDate: "2004-01-28"
prisma-client created: "2011-02-21T08:59:44+01:00"
prisma-client modified: "2015-04-14T00:00:00+02:00"
prisma-client post: {
prisma-client
prisma-client }
prisma-client }
prisma-client where: {
prisma-client id: "https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/organization/3-1"
prisma-client }
prisma-client ) {
prisma-client id
prisma-client type
prisma-client name
prisma-client shortName
prisma-client post
prisma-client organizationType
prisma-client classification
prisma-client startDate
prisma-client endDate
prisma-client website
prisma-client license
prisma-client keyword
prisma-client created
prisma-client modified
prisma-client web
prisma-client deleted
prisma-client }
prisma-client }
prisma-client +0ms
engine { PRISMA_DML_PATH:
engine '/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/schema.prisma',
engine PORT: '60110',
engine RUST_BACKTRACE: '1',
engine RUST_LOG: 'info',
engine OVERWRITE_DATASOURCES: '[]' } +0ms
engine { cwd: '/Users/manuelruck/Jobs/openData/oparlPrisma/prisma' } +0ms
plusX Execution permissions of /Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/runtime/query-engine-darwin are fine +0ms
engine { flags: [ '--enable-raw-queries' ] } +2ms
engine stderr Printing to stderr for debugging +51ms
engine stderr Listening on 127.0.0.1:60110 +0ms
engine stdout { timestamp: 'Mar 24 20:50:22.688',
level: 'INFO',
target: 'quaint::pooled',
fields:
{ message: 'Starting a postgresql pool with 5 connections.' } } +15ms
engine stdout { timestamp: 'Mar 24 20:50:22.702',
level: 'INFO',
target: 'prisma::server',
fields:
{ message: 'Started http server on 127.0.0.1:60110',
'log.target': 'prisma::server',
'log.module_path': 'prisma::server',
'log.file': 'query-engine/prisma/src/server.rs',
'log.line': 109 } } +11ms
engine { error:
engine Error: Error in query graph construction: InputError("The `set` argument was not provided for field `post` on `Organization`")
engine at NodeEngine.graphQLToJSError (/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/runtime/index.js:1:18853)
engine at currentRequestPromise.then.e (/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/runtime/index.js:1:16340)
engine at process._tickCallback (internal/process/next_tick.js:68:7) } +43ms
printStack callsite Error
at Object.s [as Organization] (/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/runtime/index.js:1:48389)
at Object.n.(anonymous function).n [as upsert] (/Users/manuelruck/Jobs/openData/oparlPrisma/node_modules/@prisma/client/runtime/index.js:1:50015)
at /Users/manuelruck/Jobs/openData/oparlPrisma/src/import/index.ts:79:26
at step (/Users/manuelruck/Jobs/openData/oparlPrisma/src/import/index.ts:44:23)
at Object.next (/Users/manuelruck/Jobs/openData/oparlPrisma/src/import/index.ts:25:53)
at fulfilled (/Users/manuelruck/Jobs/openData/oparlPrisma/src/import/index.ts:16:58)
at process._tickCallback (internal/process/next_tick.js:68:7) +0ms
it looks like it works when I set the post property with post: { set: post ? post : [] },
Thanks for the additional insight, now I can reproduce this now with a much simpler schema.
I think this might be reoccurrence of https://github.com/prisma/prisma-client-js/issues/422.
When pass undefined to a set operation, the following panic occurs:

When pass null to the set operation, the following panic happens:

Schema used:
model User {
id String @id @default(cuid())
names String[]
}
Client call:
// replace null with undefined accordingly
const reproCall = await db.user.upsert({
create: {
names: { set: undefined },
},
where: {
id: "something",
},
update: {
names: { set: undefined },
},
});
Version information:
@prisma/cli : 2.0.0-alpha.1031
Current platform : darwin
Query Engine : prisma 15b42f2c499c65576f47fa77108e39d86645242b (at /Users/harshit/code/reproductions/issue-568/node_modules/@prisma/cli/query-engine-darwin)
Migration Engine : migration-engine-cli 15b42f2c499c65576f47fa77108e39d86645242b (at /Users/harshit/code/reproductions/issue-568/node_modules/@prisma/cli/migration-engine-darwin)
Introspection Engine : introspection-core 15b42f2c499c65576f47fa77108e39d86645242b (at /Users/harshit/code/reproductions/issue-568/node_modules/@prisma/cli/introspection-engine-darwin)
I reproduced the same setup and input, and I can now confirm we return a known error with the message "Missing the required argument set for field post on Organization." and error code P2013. Since I think this is what we wanted, I will close this issue.