mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
ef0ca7dea2
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5478 GitOrigin-RevId: 269d33d48f7d41efc7ab4ac6efd9442c6741d08c
23 lines
946 B
Haskell
23 lines
946 B
Haskell
module Test.QuerySpec (spec) where
|
|
|
|
import Control.Monad (when)
|
|
import Data.Maybe (isJust)
|
|
import Hasura.Backends.DataConnector.API (Capabilities (..), 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.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.OrderBySpec.spec api sourceName config capabilities
|
|
when (isJust cRelationships) $
|
|
Test.QuerySpec.RelationshipsSpec.spec api sourceName config
|
|
Test.QuerySpec.AggregatesSpec.spec api sourceName config cRelationships
|