Git Product home page Git Product logo

Comments (5)

kjhf avatar kjhf commented on June 14, 2024 2

Hello from a future Google searcher --
I gave up with this and used QueryParser.parse(s""" ... ${InterpolationVariable} ... """).get instead.
Hope this helps.

from drunk.

protometa avatar protometa commented on June 14, 2024 1

Unlike the examples, I had to escape $ in the query with $$, as my Scala compiler was interpreting $ as string interpolation. So something like

val query =
    graphql"""
      query getPeople($$fams: String) {
        getPeople(families: [$$fams]) {
          name
        }
      }
    """

worked for me.

Regarding the decoders, I did have to use io.circe.generic.auto._ as shown above instead of io.circe.generic.semiauto._ as shown in the README.

There was also some Akka version dependency incompatibility that I was able to fix by including "com.typesafe.akka" %% "akka-actor" % "2.5.19" as a dependency in my project.

from drunk.

Jarlakxen avatar Jarlakxen commented on June 14, 2024

Hi @evbo !

I think you miss the var definition in the query sentence:

val query =
    graphql"""
      query getPeople($fams: String) {
        getPeople(families: [$fams]) {
          name
        }
      }
    """

also the last error could be that you miss to import circe, to have the json decoder for People and List. Try with:

  import io.circe._, io.circe.generic.auto._

from drunk.

evbo avatar evbo commented on June 14, 2024

Thanks, and I really appreciate you making this library, but since posting I've been under a tight deadline to get something working so I've implemented a fairly light weight Sangria client of my own. Just a bare bones simple akka post or get request with circe marshaling using only simple case classes to avoid complex encoding/decoding. Unless there's something else I haven't accounted for I may just stick with this approach.

thanks for getting back to me though. Love the title of this repo too, though it's a challenge to google :)

from drunk.

protometa avatar protometa commented on June 14, 2024

Rats. I'm having these exact same issues.

from drunk.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.