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

Add an option to handle enums with ugly casing #270

Merged
merged 3 commits into from
May 7, 2023

Commits on May 6, 2023

  1. Add an option to handle enums with ugly casing

    There are a bunch of places in genqlient where we just kind of hope you
    don't have ridiculous casing conflicts in your schema. Apparently with
    enum values there are actual schemas that have this problem! Now we have
    an option to disable. I ended up putting it all under `casing` instead
    of in `bindings` so we can clearly document the list of algorithms we
    support, and so we can have an `all_enums` value if you're working with
    a schema with a lot of this; in the future we may want to add similar
    behavior for types/fields, add more possible algorithms (e.g. to make
    things unexported), etc.
    
    I added tests for the new feature, although the way the tests are set up
    it wasn't convenient to do so for a schema where this is actually
    required. I also added a check for case conflicts that points you to
    this option. (I don't want to do it automatically for reasons described
    in the issue; mainly it just seemed a bit too magical.)
    
    Fixes #265.
    benjaminjkraft committed May 6, 2023
    Configuration menu
    Copy the full SHA
    675d1bc View commit details
    Browse the repository at this point in the history
  2. appease gocritic

    benjaminjkraft committed May 6, 2023
    Configuration menu
    Copy the full SHA
    0069ed3 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2023

  1. review comment

    benjaminjkraft committed May 7, 2023
    Configuration menu
    Copy the full SHA
    1c0aa33 View commit details
    Browse the repository at this point in the history