Skip to content

Commit 5b8be19

Browse files
committed
Update WAI for new API
1 parent fe03260 commit 5b8be19

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graphql-wai/src/GraphQL/Wai.hs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
{-# LANGUAGE FlexibleContexts #-}
33
{-# LANGUAGE ScopedTypeVariables #-}
44

5+
-- | Basic WAI handlers for graphql-api
56
module GraphQL.Wai
67
( toApplication
78
) where
89

910
import Protolude
1011

1112
import GraphQL (interpretAnonymousQuery)
13+
import GraphQL.API (HasObjectDefinition)
1214
import GraphQL.Resolver (HasResolver, Handler)
1315
import Network.Wai (Application, queryString, responseLBS)
1416
import GraphQL.Value.ToValue (toValue)
@@ -23,7 +25,9 @@ import qualified Data.Aeson as Aeson
2325
--
2426
-- If you have a 'Cat' type and a corresponding 'catHandler' then you
2527
-- can use "toApplication @Cat catHandler".
26-
toApplication :: forall r. (HasResolver IO r) => Handler IO r -> Application
28+
toApplication
29+
:: forall r. (HasResolver IO r, HasObjectDefinition r)
30+
=> Handler IO r -> Application
2731
toApplication handler = app
2832
where
2933
app req respond =

0 commit comments

Comments
 (0)