diff --git a/config/stack.yaml b/config/stack.yaml index b9462382ba..cc1d9d7df6 100644 --- a/config/stack.yaml +++ b/config/stack.yaml @@ -74,6 +74,9 @@ rules: aeson: - 1.4.4 - 3.0.0 + attoparsec-aeson: + - 2.1.0 + - '3' base: - 4.7.0 - 5.0.0 @@ -158,7 +161,4 @@ rules: yaml: - 0.8.32 - 1.0.0 - attoparsec-aeson: - - 2.1.0 - - 3 version: 0.27.3 diff --git a/examples/scotty-freer-simple/morpheus-graphql-examples-scotty-freer.cabal b/examples/scotty-freer-simple/morpheus-graphql-examples-scotty-freer.cabal new file mode 100644 index 0000000000..97ad5f1075 --- /dev/null +++ b/examples/scotty-freer-simple/morpheus-graphql-examples-scotty-freer.cabal @@ -0,0 +1,46 @@ +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.35.0. +-- +-- see: https://github.com/sol/hpack + +name: morpheus-graphql-examples-scotty-freer +version: 0.1.0.0 +description: example of graphql apis with scotty and freer-simple +homepage: https://github.com/githubuser/morpheus-graphql-examples-scotty-freer-simple#readme +bug-reports: https://github.com/githubuser/morpheus-graphql-examples-scotty-freer-simple/issues +author: Author name here +maintainer: example@example.com +copyright: 2021 Author name here +license: BSD3 +build-type: Simple + +source-repository head + type: git + location: https://github.com/githubuser/morpheus-graphql-examples-scotty-freer-simple + +executable scotty-freer-server + main-is: Main.hs + other-modules: + API + DeityRepo + ExampleDeityRepoHandler + Lib + Scotty + Types + Paths_morpheus_graphql_examples_scotty_freer + hs-source-dirs: + src + ghc-options: -Wall + build-depends: + base >=4.7 && <5 + , bytestring + , file-embed + , freer-simple + , morpheus-graphql + , scotty + , text + , transformers + , wai + , warp + default-language: Haskell2010 diff --git a/morpheus-graphql-app/src/Data/Morpheus/App/Internal/Resolving/RootResolverValue.hs b/morpheus-graphql-app/src/Data/Morpheus/App/Internal/Resolving/RootResolverValue.hs index 6c7907fb27..e5d10d1b0e 100644 --- a/morpheus-graphql-app/src/Data/Morpheus/App/Internal/Resolving/RootResolverValue.hs +++ b/morpheus-graphql-app/src/Data/Morpheus/App/Internal/Resolving/RootResolverValue.hs @@ -89,11 +89,15 @@ runRootResolverValue subscriptionResolver, channelMap } - ctx@ResolverContext {operation = Operation {..}} = + ctx@ResolverContext {operation = Operation {..}, config} = selectByOperation operationType where selectByOperation OPERATION_QUERY = - runResolver channelMap (rootResolver (withIntroFields <$> queryResolver) operationSelection) ctx + runResolver channelMap (rootResolver fields operationSelection) ctx + where + fields + | introspection config = defaultFields <$> queryResolver + | otherwise = queryResolver selectByOperation OPERATION_MUTATION = runResolver channelMap (rootResolver mutationResolver operationSelection) ctx selectByOperation OPERATION_SUBSCRIPTION = diff --git a/stack.yaml b/stack.yaml index 5ba6c21ad2..1353c873bc 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,4 @@ -allow-newer: true -resolver: nightly-2023-04-23 +resolver: lts-19.28 save-hackage-creds: false packages: - examples/client @@ -7,9 +6,9 @@ packages: - examples/code-gen-docs - examples/scotty - examples/scotty-haxl + - examples/scotty-freer-simple - examples/servant - examples/yesod-pubsub - - morpheus-graphql-benchmarks - morpheus-graphql-tests - morpheus-graphql-core - morpheus-graphql-code-gen-utils @@ -20,6 +19,8 @@ packages: - morpheus-graphql-server - morpheus-graphql extra-deps: + - dependent-map-0.2.4.0 + - dependent-sum-0.4 - fraxl-0.3.0.0 - haxl-2.4.0.0 - type-aligned-0.9.6