-- Do not manually edit this file, it was auto-generated by dillonkearns/elm-graphql -- https://github.com/dillonkearns/elm-graphql module Github.Enum.RefOrderField exposing (RefOrderField(..), decoder, toString) import Json.Decode as Decode exposing (Decoder) {-| Properties by which ref connections can be ordered. - TagCommitDate - Order refs by underlying commit date if the ref prefix is refs/tags/ - Alphabetical - Order refs by their alphanumeric name -} type RefOrderField = TagCommitDate | Alphabetical decoder : Decoder RefOrderField decoder = Decode.string |> Decode.andThen (\string -> case string of "TAG_COMMIT_DATE" -> Decode.succeed TagCommitDate "ALPHABETICAL" -> Decode.succeed Alphabetical _ -> Decode.fail ("Invalid RefOrderField type, " ++ string ++ " try re-running the @dillonkearns/elm-graphql CLI ") ) {-| Convert from the union type representating the Enum to a string that the GraphQL server will recognize. -} toString : RefOrderField -> String toString enum = case enum of TagCommitDate -> "TAG_COMMIT_DATE" Alphabetical -> "ALPHABETICAL"