You need to have a marshaller that can turn your ServerSentEvents into data
to send over the wire. I'd recommend you to read up on the basics here:
http://doc.akka.io/docs/akka-http/10.0.7/scala/http/common/marshalling.html#marshalling


The SSE connector from Alpakka which you seem to be using deals with
connecting to a server and handling the streaming response back, but you
are trying use classes from it to stream events from your server. There is
another section in the docs about streaming body responses that should also
be helpful:
http://doc.akka.io/docs/akka-http/10.0.7/scala/http/routing-dsl/source-streaming-support.html#source-streaming

--
Johan
Akka Team


On Wed, Apr 26, 2017 at 1:22 PM, <[email protected]> wrote:

> Hi,
>
> I am using akka http for graphql sangria subscription.
> It is working fine in example application but while integrating graphql
> subscription code with this
> <https://github.com/sangria-graphql/sangria-relay-playground> simple
> query mutation code it is giving compilation error.
> Below is the code i'm trying to execute:
>
> complete(
>   executor.prepare(queryAst, ctx, (), operation, variables)
>     .map { preparedQuery ⇒
>       ToResponseMarshallable(preparedQuery.execute()
>         .map(result ⇒ ServerSentEvent(result.compactPrint))
>         .recover { case NonFatal(error) ⇒
>           logger.error(error, "Unexpected error during event stream 
> processing.")
>           ServerSentEvent(error.getMessage)
>         })
>     }
>
> It is showing error inline:
>
>
> ToResponseMarshallable(preparedQuery.execute()
>
>
> and i'm getting:
>
>
> could not find implicit value for parameter _marshaller: 
> akka.http.scaladsl.marshalling.ToResponseMarshaller[akka.stream.scaladsl.Source[de.heikoseeberger.akkasse.ServerSentEvent,akka.NotUsed]]
>
>
> Can some one help me to resolve this error
>
>
> Thanks
>
>
>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to