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
The evalDirectiveArgDirect function, which is called during processFragment does not accept a StringValue as an acceptable value type and throws an error:
exportfunctionevalDirectiveArgDirect<T=unknown>(directive: DirectiveNode,argumentName: string,variableValuesStep: __TrackedValueStep,defaultValue: T,): T|undefined{if(!directive.arguments)returndefaultValue;constargument=directive.arguments.find((a)=>a.name.value===argumentName,);if(argument!==undefined){constvalue=argument.value;switch(value.kind){case"Variable": {returnvariableValuesStep.get(value.name.value).eval();}case"BooleanValue": {returnvalue.valueasany;}case"IntValue": {returnparseInt(value.value,10)asany;}case"NullValue": {returnnullasany;}// <------------------- NO STRINGS!!!!default: {thrownewSafeError(`Unsupported @${directive.name}(${argumentName}:) argument; expected Variable, Boolean or null; but received '${value.kind}'`,);}}}else{returndefaultValue;}}
Steps to reproduce
Install the StreamDeferPlugin from graphile-build
Install graphql version 16.1.0-experimental-stream-defer.6
create dummy tables and add the @defer(label: "any string label will throw") directive to a fragment
Summary
The
evalDirectiveArgDirect
function, which is called duringprocessFragment
does not accept aStringValue
as an acceptable value type and throws an error:Steps to reproduce
Install the
StreamDeferPlugin
fromgraphile-build
Install graphql version
16.1.0-experimental-stream-defer.6
create dummy tables and add the
@defer(label: "any string label will throw")
directive to a fragmentExpected results
String values should be used.
Actual results
It errs
Additional context
Possible Solution
Permit String Arguments to be used(?)
Will investigate and submit a PR eventually
The text was updated successfully, but these errors were encountered: