Report error when a project has multiple definitions for an operation instead of crashing #275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #252
The resulting behavior is an error in the console that can the be recovered instead of crashing the server up to 5 times before vs code requires a full reload to resume operations.
In my case, devs sometimes copy/paste an operation (it's wrong I know, but it happens). GraphQL Codegen doesn't alert on it because the 2 operations are exactly the same, no harm no foul.
But having this extension crash without any meaningful error message makes it really for us to fix our stuff.
I tried a production build and replaced it in my extension folder. This is the result I'm seeing.
![image](https://private-user-images.githubusercontent.com/4157103/405705118-0925d5f3-de6b-4b0f-9ef0-c5667a0db8c7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzAwNDMsIm5iZiI6MTczOTA2OTc0MywicGF0aCI6Ii80MTU3MTAzLzQwNTcwNTExOC0wOTI1ZDVmMy1kZTZiLTRiMGYtOWVmMC1jNTY2N2EwZGI4YzcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMDI1NTQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTU5YzI3MjczZGRiYzIwMWRmNDA3ODBhNDNlM2ViNTRjOTExYmI5NWZiODRlZDNhMjIwZDE5YmI2MmZmZWI4YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.X5V-3aF5b5gszhiljan2dH9apsMnCHD6u-T0NVbLv-A)