-
-
Notifications
You must be signed in to change notification settings - Fork 109
Description
We have a GraphQL backend, where one of our developers recently added a sortBy
type, which caused us some trouble, given that a SortBy
type already existed. The GraphQL standard defines that types must have unique names, but doesn't specify anything about case sensitivity as far as I can tell, so it seems like this is legal.
Using elm-graphql to generate our Elm code, it would only generate one SortBy
module, non-deterministically letting one type overwrite the other. This made the issue go undetected by the developer who introduced the change, since only one of the two types were actually used on our front-end at the time, so the build would be green if the right type was generated.
The fix was pretty simple once we knew what the issue was, since we don't want disparate types that are named so closely, so we prefixed the type names with more info. However, it would be nice if elm-graphql could warn or fail completely in this situation, since the generated code is arguably invalid. But if it's troublesome to support, it's also not a huge deal, since the problem was relatively straight forward to deal with 🙂