We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress of the issue based on the Contributor Workflow
Make sure to fork this template and run yarn generate in the terminal. Please make sure Mesh package versions under package.json matches yours.
Make sure to fork this template and run yarn generate in the terminal.
yarn generate
Please make sure Mesh package versions under package.json matches yours.
package.json
Describe the bug
In Interpolator.js, function applyRule has:
Interpolator.js
applyRule
applyRule(str, rule, data = {}) { const dataToReplace = this.applyData(rule.key, data); if (dataToReplace) { return str.replace(rule.replace, this.applyModifiers(rule.modifiers, dataToReplace, data)); } else if (rule.alternativeText) { return str.replace( rule.replace, this.applyModifiers(rule.modifiers, rule.alternativeText, data), ); } const defaultModifier = this.applyModifiers(rule.modifiers, rule.key, data); if (defaultModifier === rule.key) { return str.replace(rule.replace, ''); } return str.replace(rule.replace, defaultModifier); }
So, when dataToReplace is 0, str.replace(rule.replace, '') will be returned.
dataToReplace
0
str.replace(rule.replace, '')
To Reproduce Steps to reproduce the behavior:
parse string /users/{args.userId}/carts/{args.cartId}/entries/{args.entryNumber}, data is
/users/{args.userId}/carts/{args.cartId}/entries/{args.entryNumber}
data
{ args: { cartId: '00001017', entryNumber: 0, userId: 'current' } }
expected result is: /users/current/carts/00001017/entries/0 but what we got is: /users/current/carts/00001017/entries
/users/current/carts/00001017/entries/0
/users/current/carts/00001017/entries
Expected behavior
Environment:
@graphql-mesh/...
Additional context
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Github,
Stackblitz
or
CodeSandbox
Describe the bug
In
Interpolator.js
, functionapplyRule
has:So, when
dataToReplace
is0
,str.replace(rule.replace, '')
will be returned.To Reproduce Steps to reproduce the behavior:
parse string
/users/{args.userId}/carts/{args.cartId}/entries/{args.entryNumber}
,data
isexpected result is:
/users/current/carts/00001017/entries/0
but what we got is:
/users/current/carts/00001017/entries
Expected behavior
Environment:
@graphql-mesh/...
:Additional context
The text was updated successfully, but these errors were encountered: