Skip to content

Commit

Permalink
update packages (#251)
Browse files Browse the repository at this point in the history
* move to stackage 12.4

* upgrade pg-client

* docker build improvements
  • Loading branch information
0x777 authored Aug 8, 2018
1 parent cffa808 commit c901767
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 4 additions & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.stack-work*
graphql-engine.prof*
ws
graphiql
3 changes: 2 additions & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ project := graphql-engine
registry := hasura
version := $(shell ../scripts/get-version.sh)

stack_resolver := lts-11.15
# TODO: needs to be replaced with something like yq
stack_resolver := $(shell grep '^resolver:' stack.yaml | awk '{print $$2;}')
packager_ver := 1.2
project_dir := $(shell pwd)
build_dir := $(project_dir)/$(shell stack path --dist-dir)/build
Expand Down
3 changes: 2 additions & 1 deletion server/src-lib/Hasura/GraphQL/Transport/HTTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ runGQ pool isoL userInfo gCtxMap req = do
(opTy, fields) <- runReaderT (VQ.validateGQ req) gCtx
when (opTy == G.OperationTypeSubscription) $ throw400 UnexpectedPayload
"subscriptions are not supported over HTTP, use websockets instead"
resp <- runTx $ R.resolveSelSet userInfo gCtx opTy fields
let tx = R.resolveSelSet userInfo gCtx opTy fields
resp <- liftIO (runExceptT $ runTx tx) >>= liftEither
return $ encodeGQResp $ GQSuccess resp
where
gCtx = getGCtx (userRole userInfo) gCtxMap
Expand Down
9 changes: 5 additions & 4 deletions server/src-lib/Hasura/Server/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ runQuery
-> RQLQuery -> m (BL.ByteString, SchemaCache)
runQuery pool isoL userInfo sc query = do
tx <- liftEither $ buildTxAny userInfo sc query
Q.runTx pool (isoL, Nothing) $ setHeadersTx userInfo >> tx
res <- liftIO $ runExceptT $ Q.runTx pool (isoL, Nothing) $
setHeadersTx userInfo >> tx
liftEither res

buildExplainTx
:: UserInfo
Expand All @@ -131,10 +133,9 @@ buildExplainTx userInfo sc q = do
qEnv = QCtx userInfo sc

runExplainQuery
:: (MonadIO m, MonadError QErr m)
=> Q.PGPool -> Q.TxIsolation
:: Q.PGPool -> Q.TxIsolation
-> UserInfo -> SchemaCache
-> SelectQuery -> m BL.ByteString
-> SelectQuery -> ExceptT QErr IO BL.ByteString
runExplainQuery pool isoL userInfo sc query = do
tx <- liftEither $ buildExplainTx userInfo sc query
Q.runTx pool (isoL, Nothing) $ setHeadersTx userInfo >> tx
Expand Down
8 changes: 5 additions & 3 deletions server/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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

# Local packages, usually specified by relative directory name
packages:
- '.'
# - '../../../graphql-parser-hs'
# - '../../graphql-parser-hs'
# - extra-libs/aeson
# - extra-libs/logger/wai-logger

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

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

0 comments on commit c901767

Please sign in to comment.