Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fixes #342
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Jan 7, 2023
1 parent 517d5dd commit 3d0a80e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions adapter/protobuf/src/Mu/Quasi/GRpc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import GHC.TypeLits
import Language.Haskell.TH
import Language.ProtocolBuffers.Parser
import qualified Language.ProtocolBuffers.Types as P
import Network.HTTP.Client
import Servant.Client.Core.BaseUrl

import Mu.Quasi.ProtoBuf
import Mu.Rpc
Expand Down
2 changes: 1 addition & 1 deletion graphql/mu-graphql.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: mu-graphql
version: 0.5.0.3
version: 0.5.0.4
synopsis: GraphQL support for Mu
description: GraphQL servers and clients for Mu-Haskell
cabal-version: >=1.10
Expand Down
11 changes: 7 additions & 4 deletions graphql/src/Mu/GraphQL/Query/Introspection.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Data.Int (Int32)
import Data.Maybe (catMaybes, fromMaybe)
import Data.Proxy
import qualified Data.Text as T
import Data.UUID (UUID)
import GHC.TypeLits
import Mu.Rpc
import qualified Mu.Schema as Mu
Expand Down Expand Up @@ -67,21 +68,21 @@ data TypeKind
= SCALAR
| OBJECT
| INTERFACE
| UNION
| UNION
| ENUM
| INPUT_OBJECT
| LIST
| NON_NULL
deriving Show

tSimple :: T.Text -> Type
tSimple t = Type SCALAR (Just t) [] [] [] Nothing
tSimple t = Type SCALAR (Just t) [] [] [] Nothing

tList :: Type -> Type
tList = Type LIST Nothing [] [] [] . Just

tNonNull :: Type -> Type
tNonNull = Type NON_NULL Nothing [] [] [] . Just
tNonNull = Type NON_NULL Nothing [] [] [] . Just

unwrapNonNull :: Type -> Maybe Type
unwrapNonNull (Type NON_NULL _ _ _ _ x) = x
Expand Down Expand Up @@ -188,7 +189,7 @@ instance ( KnownSymbol sname, KnownSymbols elts
introspectServices _ psub = do
let name = T.pack $ symbolVal (Proxy @sname)
tys = map tSimple (symbolsVal (Proxy @elts))
t = Type UNION (Just name) [] [] tys Nothing
t = Type UNION (Just name) [] [] tys Nothing
-- add this one to the mix
tell (HM.singleton name t)
-- continue with the rest
Expand Down Expand Up @@ -281,6 +282,8 @@ instance IntrospectTypeRef ('PrimitiveRef JSON.Value) where
introspectTypeRef _ _ = pure $ tNonNull $ tSimple "JSON"
instance IntrospectTypeRef ('PrimitiveRef JSON.Object) where
introspectTypeRef _ _ = pure $ tNonNull $ tSimple "JSONObject"
instance IntrospectTypeRef ('PrimitiveRef UUID) where
introspectTypeRef _ _ = pure $ tNonNull $ tSimple "UUID"

instance (IntrospectTypeRef r)
=> IntrospectTypeRef ('ListRef r) where
Expand Down

0 comments on commit 3d0a80e

Please sign in to comment.