-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
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
Unhandled error for GraphQL query #3087
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Hello @readeral 👋 It looks like you didn't include the full Salesforce CLI version information in your issue. A few more things to check:
Thank you! |
hey, I agree with your suggestion but unfortunately that error comes from the metadata API (component failures), the CLI only prints render them in the failures table. The Metadata API team doesn't take requests from GH. |
Sure thanks
…On Fri, 1 Nov 2024 at 3:10 am, Cristian Dominguez ***@***.***> wrote:
hey, I agree with your suggestion but unfortunately that error comes from
the metadata API (component failures), the CLI only prints render them in
the failures table.
The Metadata API team doesn't take requests from GH.
—
Reply to this email directly, view it on GitHub
<#3087 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADZK3CAPAFGQHUWW3WAKOITZ6JI6LAVCNFSM6AAAAABQ3JJBNKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJQGI3DONJZGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Summary
When trying to deploy a LWC that uses lightning/uiGraphQLApi, if the query template-literal misuses an alias for an id field (for example
masterId: Id
) the error returned is unhandled and so a generic error for deployment failure is listed:Index 1 out of bounds for length 1
This would send a developer looking for a poorly referenced array in their component, but in this case the missing array is within the cli toolchain.
Steps To Reproduce
Use https://github.com/trailheadapps/lwc-recipes/tree/main/force-app/main/default/lwc/graphqlContacts, and edit the graphQl query to include an alias for the Id field:
Deploying will fail.
Expected result
Error should return in keeping with existing graphql query errors (e.g. for Invalid syntax or FieldUndefined validation error) such as:
Illegal use of alias for Id field
or similarActual result
Deployment fails with generic deployment error
Index 1 out of bounds for length 1
Additional information
Obviously using an alias for the Id field is an anti-pattern, and the documentation only encourages the use of aliases with custom fields, but the mistake is very difficult to pick up when other standard fields can be aliased without trouble and other malformed query strings have specific errors.
System Information
The text was updated successfully, but these errors were encountered: