Motivation
@AntonioVentilii might have found a bug in the parser
// NOT GOOD
export const searchProfiles = defineQuery({
args: j.strictObject({
query: j.string()
}),
result: j.strictObject({
items: j.array(UserProfileSchema)
}),
handler: ({ query }) => ({
items: searchProfilesFn(query)
})
});
// THIS IS OK
export const searchProfiles = defineQuery({
args: j.strictObject({
queryStr: j.string()
}),
result: j.strictObject({
items: j.array(UserProfileSchema)
}),
handler: ({ queryStr }) => ({
items: searchProfilesFn(queryStr)
})
});
or even principal
// NOT GOOD
export const getProfile = defineQuery({
args: j.strictObject({
principal: PrincipalTextSchema
}),
result: j.strictObject({
profile: j.optional(UserProfileSchema)
}),
handler: ({ principal }) => ({
profile: getProfileFn(principal)
})
});
// GOOD
export const getProfile = defineQuery({
args: j.strictObject({
principalStr: PrincipalTextSchema
}),
result: j.strictObject({
profile: j.optional(UserProfileSchema)
}),
handler: ({ principalStr }) => ({
profile: getProfileFn(principalStr)
})
});
Motivation
@AntonioVentilii might have found a bug in the parser
or even principal