0
嘗試保存Compat模式突變時看到此錯誤。看起來它可能與查詢的特定於中繼的部分(邊緣/節點)有關。我們如何解決這個問題?繼電器現代compat模式:undefined不是一個對象(評估'taggedNode [CLASSIC_NODE]')
查詢從Relay Classic中工作的最低限度更新 - 只有newWorkoutEntryEdge已充實以獲取節點和子成員。
突變代碼:
const mutationQuery = graphql`
mutation AddWorkoutEntryMutation($input: AddWorkoutEntryInput!,
$dateOfEntry: String!) {
AddWorkoutEntry(input: $input) {
clientMutationId
newWorkoutEntryEdge {
node {
id
category
description
notes
countOfRepetitions
}
}
userData {
id,
workoutEntries(first: 10000,
dateOfEntries: $dateOfEntry)
{
edges {
node {
id
category
description
notes
countOfRepetitions
}
}
}
}
}
}`
;
export default function AddWorkoutEntryMutation(
notes: string,
countOfRepetitions: string,
dateOfEntry: string,
standardWorkoutID: string,
userDataID: string)
{
const variables = {
input: {
notes,
countOfRepetitions,
dateOfEntry,
standardWorkoutID
},
// possibly redundant
dateOfEntry
};
commitMutation(Relay.Store, { mutationQuery, variables });
}