Spectrum is now read-only. Learn more about the decision in our official announcement.


🔴 The Prisma Spectrum community is not officially managed by Prisma's support team any more. Please seek help on GitHub or on Slack instead. Learn more:


Prisma watercooler

March 20, 2019 at 8:32am
Show previous messages

August 2, 2020 at 5:01pm
Hello Everyone I am new to Prisma & I am facing an issue & I am not sure how to resolve it The details are:-
```model Story { id Int (autoincrement()) storyNumber String createdAt DateTime (now()) type String? priority String? title String? state String description String? itemAuthor User (name: "CreatedPosts", fields: [itemAuthorId], references: [id]) itemAuthorId Int itemAssigned User? (name: "AssignedPosts", fields: [itemAssignedId], references: [id]) itemAssignedId Int? }
model User { id Int (autoincrement()) name String email String password String links Link[] votes Vote[] itemCreated Story[] ("CreatedPosts") itemAssigned Story[] ("AssignedPosts") }``` My Mutation Object is:-
postStory(storyNumber: String!, type: String!, priority: String, title: String, state: String!, description: String, storyAssignedTo: Int): Story
The code is:-
const postStory = async (parent, args, context, info) => {
const authorId = getUserId(context);
if (!authorId) {
throw new Error("Missing Token");
let payLoad = {
storyNumber: args.storyNumber,
type: args.type,
priority: args.priority,
title: args.title,
state: args.state,
storyAuthor: {
connect: {id: authorId}
let assignedToUser = await context.prisma.user.findOne({
where: {
id: args.storyAssignedTo
if (assignedToUser) {
payLoad = {
storyAssignedTo: {
connect: {id:}
const newStory = context.prisma.story.create({
data: {
return newStory
Whenever I execute this I get an Error
"data": {
"postStory": null
"errors": [
"message": "\nInvalid `prisma.story.create()` invocation in\n/Users/aditya.padhi/Documents/jiraclonebackend/src/resolvers/Mutation.js:112:43\n\n\n The change you are trying to make would violate the required relation 'StoryAuthor' between the `Story` and `User` models.",
"locations": [
"line": 2,
"column": 3
"path": [
can someone suggest what exactly I am missing.? Thank-You In Advance

September 16, 2020 at 4:28pm
storyAssignedTo and storyAuthor are not Story model properties
storyAuthor should be replaced by itemAuthor and storyAssignedTo by itemAssigned inside your payload

March 23, 2021 at 5:32pm
Hey folks--I have a typescript repo that fails on tsc compilation with type errors. When I run sls package with your typescript plugin, however, it just logs those errors, but continues on its merry way. How do I configure the plugin to fail sls package on typescript compilation errors/warnings?