mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-19 05:21:47 +03:00
88c5b14c3d
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5603 GitOrigin-RevId: b9255d265ceb88d96643c95f409387fb93df6676
26 lines
761 B
Haskell
26 lines
761 B
Haskell
module Hasura.Backends.DataConnector.API.V0.Explain
|
|
( ExplainResponse (..),
|
|
)
|
|
where
|
|
|
|
import Autodocodec
|
|
import Autodocodec.OpenAPI ()
|
|
import Data.Aeson (FromJSON, ToJSON)
|
|
import Data.OpenApi (ToSchema)
|
|
import Data.Text (Text)
|
|
import Prelude
|
|
|
|
data ExplainResponse = ExplainResponse
|
|
{ _erLines :: [Text],
|
|
_erQuery :: Text
|
|
}
|
|
deriving stock (Eq, Ord, Show)
|
|
deriving (ToJSON, FromJSON, ToSchema) via Autodocodec ExplainResponse
|
|
|
|
instance HasCodec ExplainResponse where
|
|
codec =
|
|
named "ExplainResponse" . object "ExplainResponse" $
|
|
ExplainResponse
|
|
<$> requiredField "lines" "Lines of the formatted explain plan response" .= _erLines
|
|
<*> requiredField "query" "The generated query - i.e. SQL for a relational DB" .= _erQuery
|