Skip to content
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

Include full apollo error messages when running tests #1532

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

jamescrowley
Copy link
Contributor

So we get meaningful errors in test console output like this:

Missing field 'requestedOn' while writing result { "__typename": "TransferAgreement", "comment": "", "id": "1", "requestedBy": { "__typename": "User", "id": "1", "name": "some admin" }, "shipments": [], "targetBases": [ { "__typename": "Base", "id": "2", "name": "Thessaloniki" }, { "__typename": "Base", "id": "3", "name": "Samos" }, { "__typename": "Base", "id": "4", "name": "Athens" } ], "targetOrganisation": { "__typename": "Organisation", "id": "2", "name": "BoxCare" }, "state": "Accepted", "sourceBases": [ { "__typename": "Base", "id": "1", "name": "Lesvos" } ], "sourceOrganisation": { "__typename": "Organisation", "id": "1", "name": "BoxAid" }, "type": "SendingTo", "validFrom": "2023-01-26T00:00:00+00:00", "validUntil": null }

as opposed to

https://www.apollographql.com/docs/react/errors#%7B%22version%22%3A%223.11.8%22%2C%22message%22%3A12%2C%22args%22%3A%5B%22requestedOn%22%2C%22%7B%5Cn%20%20%5C%22__typename%5C%22%3A%20%5C%22TransferAgreement%5C%22%2C%5Cn%20%20%5C%22comment%5C%22%3A%20%5C%22%5C%22%2C%5Cn%20%20%5C%22id%5C%22%3A%20%5C%221%5C%22%2C%5Cn%20%20%5C%22requestedBy%5C%22%3A%20%7B%5Cn%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22User%5C%22%2C%5Cn%20%20%20%20%5C%22id%5C%22%3A%20%5C%221%5C%22%2C%5Cn%20%20%20%20%5C%22name%5C%22%3A%20%5C%22some%20admin%5C%22%5Cn%20%20%7D%2C%5Cn%20%20%5C%22shipments%5C%22%3A%20%5B%5D%2C%5Cn%20%20%5C%22targetBases%5C%22%3A%20%5B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22Base%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22id%5C%22%3A%20%5C%222%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22name%5C%22%3A%20%5C%22Thessaloniki%5C%22%5Cn%20%20%20%20%7D%2C%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22Base%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22id%5C%22%3A%20%5C%223%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22name%5C%22%3A%20%5C%22Samos%5C%22%5Cn%20%20%20%20%7D%2C%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22Base%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22id%5C%22%3A%20%5C%224%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22name%5C%22%3A%20%5C%22Athens%5C%22%5Cn%20%20%20%20%7D%5Cn%20%20%5D%2C%5Cn%20%20%5C%22targetOrganisation%5C%22%3A%20%7B%5Cn%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22Organisation%5C%22%2C%5Cn%20%20%20%20%5C%22id%5C%22%3A%20%5C%222%5C%22%2C%5Cn%20%20%20%20%5C%22name%5C%22%3A%20%5C%22BoxCare%5C%22%5Cn%20%20%7D%2C%5Cn%20%20%5C%22state%5C%22%3A%20%5C%22Accepted%5C%22%2C%5Cn%20%20%5C%22sourceBases%5C%22%3A%20%5B%5Cn%20%20%20%20%7B%5Cn%20%20%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22Base%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22id%5C%22%3A%20%5C%221%5C%22%2C%5Cn%20%20%20%20%20%20%5C%22name%5C%22%3A%20%5C%22Lesvos%5C%22%5Cn%20%20%20%20%7D%5Cn%20%20%5D%2C%5Cn%20%20%5C%22sourceOrganisation%5C%22%3A%20%7B%5Cn%20%20%20%20%5C%22__typename%5C%22%3A%20%5C%22Organisation%5C%22%2C%5Cn%20%20%20%20%5C%22id%5C%22%3A%20%5C%221%5C%22%2C%5Cn%20%20%20%20%5C%22name%5C%22%3A%20%5C%22BoxAid%5C%22%5Cn%20%20%7D%2C%5Cn%20%20%5C%22type%5C%22%3A%20%5C%22SendingTo%5C%22%2C%5Cn%20%20%5C%22validFrom%5C%22%3A%20%5C%222023-01-26T00%3A00%3A00%2B00%3A00%5C%22%2C%5Cn%20%20%5C%22validUntil%5C%22%3A%20null%5Cn%7D%22%5D%7D

@jamescrowley jamescrowley changed the title Include full apollo error messages in dev environment / tests Include full apollo error messages when running tests Sep 13, 2024
@HaGuesto
Copy link
Member

amazing @jamescrowley. I was always anoyed by that.

@HaGuesto
Copy link
Member

code review passed

For @fhenrich33 to merge when he thinks fit.

@HaGuesto
Copy link
Member

@jamescrowley jamescrowley merged commit 4e70488 into master Oct 8, 2024
11 checks passed
@jamescrowley jamescrowley deleted the apolloErrors branch October 8, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants