Skip to content

Commit

Permalink
Fix spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Jan 8, 2023
1 parent e2dcb98 commit 4e2412e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions graphql/src/Mu/GraphQL/Query/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{-# language TypeOperators #-}
{-# language UndecidableInstances #-}
{-# language ViewPatterns #-}
{-# OPTIONS_GHC -Wincomplete-patterns -fno-warn-orphans #-}
{-# OPTIONS_GHC -Wincomplete-patterns -fno-warn-orphans #-}

module Mu.GraphQL.Query.Parse where

Expand Down Expand Up @@ -353,7 +353,7 @@ instance ( ParseMethod p ('Service s methods) methods, KnownName s )
go (GQL.InlineFragmentSelection (GQL.InlineFragment ty dirs innerSs _) : ss)
| any (shouldSkip vmap) dirs
= go ss
| Nothing <- ty
| Nothing <- ty
= go (F.toList innerSs ++ ss)
| Just selectedTy <- ty
= let thisTy = T.pack (nameVal (Proxy @s))
Expand Down Expand Up @@ -518,19 +518,19 @@ class ParseMaybeArg (p :: Package') (a :: TypeRef Symbol) where
-> Maybe GQL.Value
-> f (ArgumentValue' p a)

instance {-# OVERLAPS #-} (ParseArg p a)
instance {-# OVERLAPS #-} (ParseArg p a)
=> ParseMaybeArg p ('OptionalRef a) where
parseMaybeArg vmap aname (Just x)
= ArgOptional . Just <$> parseArg' vmap aname x
parseMaybeArg _ _ Nothing
= pure $ ArgOptional Nothing
instance {-# OVERLAPS #-} (ParseArg p a)
instance {-# OVERLAPS #-} (ParseArg p a)
=> ParseMaybeArg p ('ListRef a) where
parseMaybeArg vmap aname (Just x)
= parseArg' vmap aname x
parseMaybeArg _ _ Nothing
= pure $ ArgList []
instance {-# OVERLAPPABLE #-} (ParseArg p a)
instance {-# OVERLAPPABLE #-} (ParseArg p a)
=> ParseMaybeArg p a where
parseMaybeArg vmap aname (Just x)
= parseArg' vmap aname x
Expand Down Expand Up @@ -816,7 +816,7 @@ instance (KnownName name, ParseField sch fields)
parseSchemaQuery ::
forall (sch :: Schema') t (rname :: Symbol) fields f.
( MonadError T.Text f
, t ~  'DRecord rname fields
, t ~ 'DRecord rname fields
, KnownName rname
, ParseField sch fields ) =>
Proxy sch ->
Expand Down
20 changes: 10 additions & 10 deletions graphql/src/Mu/GraphQL/Query/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{-# language TypeFamilies #-}
{-# language TypeOperators #-}
{-# language UndecidableInstances #-}
{-# OPTIONS_GHC -fprint-explicit-foralls #-}
{-# OPTIONS_GHC -fprint-explicit-foralls #-}
module Mu.GraphQL.Query.Run (
GraphQLApp
, runPipeline
Expand Down Expand Up @@ -267,7 +267,7 @@ runSubscription f req whole@(Services ss) path

class RunQueryFindHandler m p whole chn ss s hs where
runQueryFindHandler
:: ( p ~ 'Package pname wholess
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
=> (forall a. m a -> ServerErrorIO a)
-> RequestHeaders
Expand All @@ -278,7 +278,7 @@ class RunQueryFindHandler m p whole chn ss s hs where
-> ServiceQuery p s
-> WriterT [GraphQLError] IO Aeson.Value
runSubscriptionFindHandler
:: ( p ~ 'Package pname wholess
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
=> (forall a. m a -> ServerErrorIO a)
-> RequestHeaders
Expand All @@ -293,7 +293,7 @@ class RunQueryFindHandler m p whole chn ss s hs where
class RunQueryOnFoundHandler m p whole chn (s :: Service snm mnm anm (TypeRef snm)) hs where
type ServiceName s :: snm
runQueryOnFoundHandler
:: ( p ~ 'Package pname wholess
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
=> (forall a. m a -> ServerErrorIO a)
-> RequestHeaders
Expand All @@ -304,7 +304,7 @@ class RunQueryOnFoundHandler m p whole chn (s :: Service snm mnm anm (TypeRef sn
-> ServiceQuery p s
-> WriterT [GraphQLError] IO Aeson.Value
runSubscriptionOnFoundHandler
:: ( p ~ 'Package pname wholess
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
=> (forall a. m a -> ServerErrorIO a)
-> RequestHeaders
Expand All @@ -320,7 +320,7 @@ instance TypeError ('Text "Could not find handler for " ':<>: 'ShowType s)
=> RunQueryFindHandler m p whole chn '[] s '[] where
runQueryFindHandler _ = error "this should never be called"
runSubscriptionFindHandler _ = error "this should never be called"
instance {-# OVERLAPPABLE #-}
instance {-# OVERLAPPABLE #-}
RunQueryFindHandler m p whole chn ss s hs
=> RunQueryFindHandler m p whole chn (other ': ss) s (h ': hs) where
runQueryFindHandler f req sch whole path (_ :<&>: that)
Expand Down Expand Up @@ -416,8 +416,8 @@ instance forall m p pname s sname whole ss chn elts.

class RunMethod m p whole chn s ms hs where
runMethod
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
=> (forall a. m a -> ServerErrorIO a)
-> RequestHeaders
-> ServerT chn GQL.Field p m whole
Expand All @@ -426,8 +426,8 @@ class RunMethod m p whole chn s ms hs where
-> NS (ChosenMethodQuery p) ms
-> WriterT [GraphQLError] IO (Maybe (T.Text, Aeson.Value))
runMethodSubscription
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
:: ( p ~ 'Package pname wholess
, inh ~ MappingRight chn (ServiceName s) )
=> (forall a. m a -> ServerErrorIO a)
-> RequestHeaders
-> ServerT chn GQL.Field p m whole
Expand Down
6 changes: 3 additions & 3 deletions graphql/src/Mu/GraphQL/Subscription/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ data ClientMessage
data ServerMessage
= GQLConnectionError { errorPayload :: Maybe A.Value }
| GQLConnectionAck
| GQLData { serverMsgId :: T.Text
| GQLData { serverMsgId :: T.Text
, payload :: A.Value }
| GQLError { serverMsgId :: T.Text
| GQLError { serverMsgId :: T.Text
, payload :: A.Value }
| GQLComplete { serverMsgId :: T.Text}
| GQLKeepAlive
| GQLKeepAlive
deriving Show

-- NOTE: using https://github.com/apollographql/subscriptions-transport-ws/blob/master/src/message-types.ts
Expand Down

0 comments on commit 4e2412e

Please sign in to comment.