mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-22 23:11:41 +03:00
04ae6abf78
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5904 GitOrigin-RevId: 6bad4c29a7d14d3881f9c57fe983d14cc41bdc4b
25 lines
1.2 KiB
Haskell
25 lines
1.2 KiB
Haskell
module Test.QuerySpec (spec) where
|
|
|
|
import Control.Monad (when)
|
|
import Data.Maybe (isJust)
|
|
import Hasura.Backends.DataConnector.API (Capabilities (..), ComparisonCapabilities (_ccCrossTableComparisonCapabilities), Config, Routes (..), SourceName)
|
|
import Servant.API (NamedRoutes)
|
|
import Servant.Client (Client)
|
|
import Test.Hspec
|
|
import Test.QuerySpec.AggregatesSpec qualified
|
|
import Test.QuerySpec.BasicSpec qualified
|
|
import Test.QuerySpec.FilteringSpec qualified
|
|
import Test.QuerySpec.OrderBySpec qualified
|
|
import Test.QuerySpec.RelationshipsSpec qualified
|
|
import Prelude
|
|
|
|
spec :: Client IO (NamedRoutes Routes) -> SourceName -> Config -> Capabilities -> Spec
|
|
spec api sourceName config capabilities@Capabilities {..} = do
|
|
describe "query API" do
|
|
Test.QuerySpec.BasicSpec.spec api sourceName config
|
|
Test.QuerySpec.FilteringSpec.spec api sourceName config cComparisons
|
|
Test.QuerySpec.OrderBySpec.spec api sourceName config capabilities
|
|
when (isJust cRelationships) $
|
|
Test.QuerySpec.RelationshipsSpec.spec api sourceName config (cComparisons >>= _ccCrossTableComparisonCapabilities)
|
|
Test.QuerySpec.AggregatesSpec.spec api sourceName config cRelationships
|