Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
piq9117 51dac7c554 added gitignore (#1) 1 år sedan
src/Data/Morpheus expored safehashmap constructor 1 år sedan
test new stuff 1 år sedan
.gitignore added gitignore (#1) 1 år sedan
LICENSE new stuff 1 år sedan
README.md new stuff 1 år sedan
changelog.md new stuff 1 år sedan
default.nix expored safehashmap constructor 1 år sedan
morpheus-graphql-core.cabal exposed all the modules 1 år sedan
package.yaml exposed all the modules 1 år sedan
shell.nix expored safehashmap constructor 1 år sedan

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)