Skip to content

Commit c901767

Browse files
authored
update packages (hasura#251)
* move to stackage 12.4 * upgrade pg-client * docker build improvements
1 parent cffa808 commit c901767

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

server/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.stack-work*
2+
graphql-engine.prof*
3+
ws
4+
graphiql

server/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ project := graphql-engine
22
registry := hasura
33
version := $(shell ../scripts/get-version.sh)
44

5-
stack_resolver := lts-11.15
5+
# TODO: needs to be replaced with something like yq
6+
stack_resolver := $(shell grep '^resolver:' stack.yaml | awk '{print $$2;}')
67
packager_ver := 1.2
78
project_dir := $(shell pwd)
89
build_dir := $(project_dir)/$(shell stack path --dist-dir)/build

server/src-lib/Hasura/GraphQL/Transport/HTTP.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ runGQ pool isoL userInfo gCtxMap req = do
3030
(opTy, fields) <- runReaderT (VQ.validateGQ req) gCtx
3131
when (opTy == G.OperationTypeSubscription) $ throw400 UnexpectedPayload
3232
"subscriptions are not supported over HTTP, use websockets instead"
33-
resp <- runTx $ R.resolveSelSet userInfo gCtx opTy fields
33+
let tx = R.resolveSelSet userInfo gCtx opTy fields
34+
resp <- liftIO (runExceptT $ runTx tx) >>= liftEither
3435
return $ encodeGQResp $ GQSuccess resp
3536
where
3637
gCtx = getGCtx (userRole userInfo) gCtxMap

server/src-lib/Hasura/Server/Query.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ runQuery
115115
-> RQLQuery -> m (BL.ByteString, SchemaCache)
116116
runQuery pool isoL userInfo sc query = do
117117
tx <- liftEither $ buildTxAny userInfo sc query
118-
Q.runTx pool (isoL, Nothing) $ setHeadersTx userInfo >> tx
118+
res <- liftIO $ runExceptT $ Q.runTx pool (isoL, Nothing) $
119+
setHeadersTx userInfo >> tx
120+
liftEither res
119121

120122
buildExplainTx
121123
:: UserInfo
@@ -131,10 +133,9 @@ buildExplainTx userInfo sc q = do
131133
qEnv = QCtx userInfo sc
132134

133135
runExplainQuery
134-
:: (MonadIO m, MonadError QErr m)
135-
=> Q.PGPool -> Q.TxIsolation
136+
:: Q.PGPool -> Q.TxIsolation
136137
-> UserInfo -> SchemaCache
137-
-> SelectQuery -> m BL.ByteString
138+
-> SelectQuery -> ExceptT QErr IO BL.ByteString
138139
runExplainQuery pool isoL userInfo sc query = do
139140
tx <- liftEither $ buildExplainTx userInfo sc query
140141
Q.runTx pool (isoL, Nothing) $ setHeadersTx userInfo >> tx

server/stack.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
44
# resolver: lts-10.8
5-
resolver: lts-11.15
5+
resolver: lts-12.4
66

77
# Local packages, usually specified by relative directory name
88
packages:
99
- '.'
10-
# - '../../../graphql-parser-hs'
10+
# - '../../graphql-parser-hs'
1111
# - extra-libs/aeson
1212
# - extra-libs/logger/wai-logger
1313

@@ -16,9 +16,11 @@ extra-deps:
1616
# use https URLs so that build systems can clone these repos
1717
# - graphql-api-0.3.0
1818
- git: https://github.com/hasura/pg-client-hs.git
19-
commit: 77995388cab656f9180b851f33f3d603cf1017c7
19+
commit: e61bc37794b4d9e281bad44b2d7c8d35f2dbc770
2020
- git: https://github.com/hasura/graphql-parser-hs.git
2121
commit: eae59812ec537b3756c3ddb5f59a7cc59508869b
22+
- Spock-core-0.13.0.0
23+
- reroute-0.5.0.0
2224

2325
# Override default flag values for local packages and extra-deps
2426
flags: {}

0 commit comments

Comments
 (0)