Skip to content

Request for help with ' No instance for (GraphQL.Resolver.HasResolver ' build error #181

@Happy0

Description

@Happy0

Sorry if this is the wrong place to ask for help. Please let me know if there's an alternative...

I started a toy project tonight to try and learn about graphQL / some more haskell (and possibly haxl for concurrently handling the graphql query): https://github.com/Happy0/lichess-graphql-api

When I try to build it I'm getting the following error:

Building executable 'lichess-graphql-api-exe' for lichess-graphql-api-0.1.0.0..
[2 of 2] Compiling Main             ( app/Main.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/lichess-graphql-api-exe/lichess-graphql-api-exe-tmp/Main.o )

/home/happy0/projects/lichess-graphql-api/app/Main.hs:12:18: error:
    • No instance for (GraphQL.Resolver.HasResolver
                         IO [Lichess.GraphQL.Model.Game.GameConnection])
        arising from a use of ‘interpretAnonymousQuery’
    • In a stmt of a 'do' block:
        testResult <- interpretAnonymousQuery
                        @Query queryHandler "query { user (id: happy0) { id } }"
      In the expression:
        do testResult <- interpretAnonymousQuery
                           @Query queryHandler "query { user (id: happy0) { id } }"
           putStrLn $ show $ encode testResult
      In an equation for ‘main’:
          main
            = do testResult <- interpretAnonymousQuery
                                 @Query queryHandler "query { user (id: happy0) { id } }"
                 putStrLn $ show $ encode testResult
   |
12 |    testResult <- interpretAnonymousQuery @Query queryHandler "query { user (id: happy0) { id } }"
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


--  While building custom Setup.hs for package lichess-graphql-api-0.1.0.0 using:
      /home/happy0/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:lichess-graphql-api exe:lichess-graphql-api-exe --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

I'm not sure how to resolve this error.

Here's some context about where the error might be coming from:

Any suggestions about what I might be doing wrong?

Thanks
Gordon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions