You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While not an error of Zeus strictly speaking, the client does not succeed in building specific malformed queries:
// Valid query
me: {id: true,contacts: {// Contact does not expect argumentsid: true,name: true}}// Crashes Zeus at runtime with a cryptic error
me: {id: true,contacts: [{},{id: true,name: true}]}
I'd like either the types to be stricter (because the invalid query is not reported at compile-time) or the runtime error to be more explicit (see below for proposal).
const ResolveReturnType = (mappedParts: Part[]) => {
if (mappedParts.length === 0) {
return 'not';
}
const oKey = ops[mappedParts[0].v];
const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
if (typeof returnP1 === 'object') {
+ if (!mappedParts[1]) throw new Error(`${mappedParts[0].v} does not take arguments`);+ // Proposal: ^ Explicit runtime error
const returnP2 = returnP1[mappedParts[1].v];
// ^^^ This thing does not exist if the field is not expecting args
if (returnP2) {
// ...
While not an error of Zeus strictly speaking, the client does not succeed in building specific malformed queries:
I'd like either the types to be stricter (because the invalid query is not reported at compile-time) or the runtime error to be more explicit (see below for proposal).
Link
I'll submit a PR with the addition
The text was updated successfully, but these errors were encountered: