Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 2e70734

Browse files
committed
Fix create mutation
1 parent 849867e commit 2e70734

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/mutation/create/field.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default ({ className, displayName, fields }, Type) => ({
66
type: Type,
77
description: `Create a new ${displayName}`,
88
args: {
9-
data: {
9+
input: {
1010
type: inputType({ className, displayName, fields }),
1111
},
1212
newAttributes: {
@@ -15,13 +15,13 @@ export default ({ className, displayName, fields }, Type) => ({
1515
}
1616
},
1717
resolve(value, args, { sessionToken }) {
18-
const { data, newProperties } = args;
19-
if (newProperties && 'objectId' in newProperties) {
18+
const { input, newAttributes } = args;
19+
if (newAttributes && 'objectId' in newAttributes) {
2020
throw new Error('objectId not allowed in a create mutation');
2121
}
2222
const object = new Parse.Object(className, {
23-
...data,
24-
...newProperties,
23+
...input,
24+
...newAttributes,
2525
});
2626
return object.save({ sessionToken });
2727
},

0 commit comments

Comments
 (0)