- 
                Notifications
    
You must be signed in to change notification settings  - Fork 33
 
Description
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:
- 
I set up my 'User' type to have a 'games' field for paging through a user's list of chess games on a chess site: https://github.com/Happy0/lichess-graphql-api/blob/master/src/Lichess/GraphQL/Model/User.hs
 - 
I set up a top level 'Query' type that has a field for getting a particular user: https://github.com/Happy0/lichess-graphql-api/blob/master/src/Lichess/GraphQL/Api.hs
 - 
And a handler for the 'Query' type: https://github.com/Happy0/lichess-graphql-api/blob/master/src/Lichess/GraphQL/Lib.hs (note: i made gameConnectionHandler return 'undefined' for now.)
 
Any suggestions about what I might be doing wrong?
Thanks
Gordon