You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
piq9117 51dac7c554 added gitignore (#1) 2 years ago
src/Data/Morpheus expored safehashmap constructor 2 years ago
test new stuff 2 years ago
.gitignore added gitignore (#1) 2 years ago
LICENSE new stuff 2 years ago
README.md new stuff 2 years ago
changelog.md new stuff 2 years ago
default.nix expored safehashmap constructor 2 years ago
morpheus-graphql-core.cabal exposed all the modules 2 years ago
package.yaml exposed all the modules 2 years ago
shell.nix expored safehashmap constructor 2 years ago

README.md

Morpheus GraphQL Core

core Functionalities of Morpheus GraphQL, can be used to build GraphQL server, client ..

  • parser
  • validar
  • api

Build GraphQL api with Core

schema :: Schema VALID
schema =
  [dsl|
  type Query {
    deity(name: String): Deity!
  }

  type Deity {
    name: String!
    power: [String!]!
  }
|]

resolver :: Monad m => RootResModel e m
resolver =
  RootResModel
    { query =
        pure $
          mkObject
            "Query"
            [("deity", resolveDeity)],
      mutation = pure mkNull,
      subscription = pure mkNull
    }

resolveDeity :: (WithOperation o, Monad m) => Resolver o e m (ResModel o e m)
resolveDeity =
  pure $
    mkObject
      "Deity"
      [ ("name", pure $ mkString "Morpheus"),
        ("power", pure $ mkList [mkString "Shapeshifting"])
      ]

api :: ByteString -> IO  ByteString
api = runApp (mkApp schema resolver)