flowyourmoney / malli-graphql

Generate GraphQL Schemas and Types from malli
MIT License
3 stars 2 forks source link

Redundant schemas? #4

Open flow-tiago opened 2 years ago

flow-tiago commented 2 years ago
(def graphql-type->schema
  {:Object (m/-map-schema)
   :InputObject (m/-map-schema)
   :Schema (m/-map-schema)
   :Union (m/-or-schema)
   :Enum (m/-enum-schema)
   :List (m/-collection-schema {:type :vector, :pred vector?, :empty []})
   :Int (m/-int-schema)
   :Float (m/-double-schema)
   :String (m/-string-schema)
   :Boolean (m/-boolean-schema)
   :ID (m/-simple-schema {:type :ID, :pred string?})}

I get that :ID or :InputSchema might be useful, but why are there :Int or :String, in example, when simply :int or :string would suffice?

oscar-s-silva commented 2 years ago

Aliases seemed like a simple way to document available functionality and improve the user experience by not having to familiarize oneself with malli types. Remove if deemed redundant.