vendrinc / elm-gql

https://www.npmjs.com/package/elm-gql
BSD 3-Clause "New" or "Revised" License
69 stars 13 forks source link

Duplicit declaration of 'null' #14

Closed richardriman closed 1 year ago

richardriman commented 1 year ago

Hi guys.

We have input object called IntFilter which contains filed named 'null'.

null : Bool -> IntFilter -> IntFilter
null newArg_ inputObj_ =
    GraphQL.Engine.addField
        "null"
        "Boolean"
        (Json.Encode.bool newArg_)
        inputObj_

In generated code is this name already used, so it doesn't compile.

null :
    { eq : IntFilter -> IntFilter
    , gt : IntFilter -> IntFilter
    , gte : IntFilter -> IntFilter
    , in_ : IntFilter -> IntFilter
    , lt : IntFilter -> IntFilter
    , lte : IntFilter -> IntFilter
    , neq : IntFilter -> IntFilter
    , nin : IntFilter -> IntFilter
    , null : IntFilter -> IntFilter
    }
null =

Can I suggest renaming this function to something, which can't collide? For example null_ or.. I don't know. You know better than me, how to call that thing.

mdgriffith commented 1 year ago

Good call, that makes sense!