mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-20 05:51:54 +03:00
6586053296
> ## Description ✍️ - Creates a new `/capabilities` endpoint for the GDC agent API - Removes capabilities from the `/schema` endpoint - Removes the `/config-schema` endpoint and includes the `ConfigSchemaResponse` within the `CapabilitiesResponse` ### Related Issues ✍ -> https://hasurahq.atlassian.net/browse/GDW-85 PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4478 GitOrigin-RevId: 426662ee9e751343d94207d439a5025df65d2de7
30 lines
1.0 KiB
Haskell
30 lines
1.0 KiB
Haskell
{-# LANGUAGE OverloadedLists #-}
|
|
{-# LANGUAGE QuasiQuotes #-}
|
|
|
|
module Hasura.Backends.DataConnector.API.V0.CapabilitiesSpec (spec) where
|
|
|
|
import Data.Aeson.QQ.Simple (aesonQQ)
|
|
import Hasura.Backends.DataConnector.API.V0.Capabilities
|
|
import Hasura.Backends.DataConnector.API.V0.ConfigSchema
|
|
import Hasura.Prelude
|
|
import Hedgehog
|
|
import Hedgehog.Gen qualified as Gen
|
|
import Test.Aeson.Utils
|
|
import Test.Hspec
|
|
|
|
spec :: Spec
|
|
spec = do
|
|
describe "Capabilities" $ do
|
|
testToFromJSONToSchema (Capabilities False) [aesonQQ|{"relationships": false}|]
|
|
jsonOpenApiProperties genCapabilities
|
|
describe "CapabilitiesResponse" $ do
|
|
testToFromJSON
|
|
(CapabilitiesResponse (Capabilities True) emptyConfigSchemaResponse)
|
|
[aesonQQ|{"capabilities": {"relationships": true}, "configSchemas": {"configSchema": {}, "otherSchemas": {}}}|]
|
|
|
|
genCapabilities :: MonadGen m => m Capabilities
|
|
genCapabilities = Capabilities <$> Gen.bool
|
|
|
|
emptyConfigSchemaResponse :: ConfigSchemaResponse
|
|
emptyConfigSchemaResponse = ConfigSchemaResponse mempty mempty
|