I am experiencing this issue after upgrading from Prisma 1.29.1 to Prisma 1.30.1
Shows this on Queries and Mutations, even when they are successful.
Here's my graphql query and mutation:
Mutation:
mutation createOrganization($args: OrganizationCreateInput!) {
createOrganization(data: $args) {
id
}
}
Query:
query getViewerOrganization {
getViewerOrganization {
id
}
}
Here's my datamodel:
type Organization {
id: ID! @unique
name: String!
.......
}
Here's my Schema:
type Mutation {
createOrganization(data: OrganizationCreateInput!): Organization!
}
type Query {
getViewerOrganization(data: OrganizationWhereInput): Organization
}
type Viewer {
me: User!
}
Here's my resolvers:
Mutation
// @ts-ignore
export const createOrganization = async (args, context) => {
try {
const id = getUserId(context);
const user = await context.db.user({id});
...........
const organization = await context.db.createOrganization({
...args.data,
owner: {
connect: {
id
}
},
users: {
connect: [
{email: user.email}
]
}
});
return {
organization
}
} catch (e) {
return new ApolloError(e.message);
}
};
Query:
// @ts-ignore
getViewerOrganization: async (parent, args, context) => {
try {
const id = await getUserId(context);
const user = await context.db.user({id});
const organization = await context.db.organization({id});
return {
organization
}
} catch (e) {
return new ApolloError(e.message);
}
},
MySQL1.30.1prisma CLI: prisma/1.30.1Windows 10What could be the issue?
Can you please add a console.log and see what the organization object contains?
Also, with the provided information, I am unable to reproduce this issue. If you are still getting this, can you please make a small repository with a minimal reproduction.
Sorry should not you replace
return {
organization
}
by return organizatoin
I was able to fix it by using
return {...organization}
or
return organization
Most helpful comment
Sorry should not you replace
return { organization }by
return organizatoin