graphql-engine/server/src-test/Hasura/Backends/DataConnector/API/V0/ScalarSpec.hs
David Overton a9f77acb32 Remove builtin scalar types from Data Connector backend
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7167
Co-authored-by: Daniel Chambers <1214352+daniel-chambers@users.noreply.github.com>
GitOrigin-RevId: 926e7282b908e3a9669ac39d625aa54971e11c37
2023-01-11 02:37:26 +00:00

23 lines
702 B
Haskell

{-# LANGUAGE QuasiQuotes #-}
module Hasura.Backends.DataConnector.API.V0.ScalarSpec (spec, genScalarType) where
import Data.Aeson.QQ.Simple (aesonQQ)
import Hasura.Backends.DataConnector.API.V0.Scalar
import Hasura.Generator.Common (defaultRange, genArbitraryAlphaNumTextExcluding)
import Hasura.Prelude
import Hedgehog
import Test.Aeson.Utils
import Test.Hspec
spec :: Spec
spec = do
describe "ScalarType" $ do
testToFromJSONToSchema (ScalarType "foo") [aesonQQ|"foo"|]
jsonOpenApiProperties genScalarType
genScalarType :: (MonadGen m, GenBase m ~ Identity) => m ScalarType
genScalarType =
ScalarType
<$> genArbitraryAlphaNumTextExcluding ["string", "number", "bool"] defaultRange