From ae2210f6598f166116abebc1163e1523d3bc627c Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 14 Jul 2020 19:37:56 +0200 Subject: Support subscriptions This is experimental support. The implementation is based on conduit and is boring. There is a new resolver data constructor that should create a source event stream. The executor receives the events, pipes them through the normal execution and puts them into the response stream which is returned to the user. - Tests are missing. - The executor should check field value resolver on subscription types. - The graphql function should probably return (Either ResponseEventStream Response), but I'm not sure about this. It will make the usage more complicated if no subscriptions are involved, but with the current API implementing subscriptions is more difficult than it should be. --- src/Language/GraphQL/Type.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Language/GraphQL/Type.hs') diff --git a/src/Language/GraphQL/Type.hs b/src/Language/GraphQL/Type.hs index 0a30924..e84fc03 100644 --- a/src/Language/GraphQL/Type.hs +++ b/src/Language/GraphQL/Type.hs @@ -1,3 +1,7 @@ +{- This Source Code Form is subject to the terms of the Mozilla Public License, + v. 2.0. If a copy of the MPL was not distributed with this file, You can + obtain one at https://mozilla.org/MPL/2.0/. -} + -- | Reexports non-conflicting type system and schema definitions. module Language.GraphQL.Type ( In.InputField(..) @@ -6,7 +10,10 @@ module Language.GraphQL.Type , Out.Field(..) , Out.InterfaceType(..) , Out.ObjectType(..) - , Out.ResolverT(..) + , Out.Resolve + , Out.Resolver(..) + , Out.SourceEventStream + , Out.Subscribe , Out.UnionType(..) , Out.argument , module Language.GraphQL.Type.Definition -- cgit v1.2.3