summaryrefslogtreecommitdiff
path: root/docs/tutorial/tutorial.rst
diff options
context:
space:
mode:
authorDanny Navarro <j@dannynavarro.net>2017-03-07 20:03:12 -0300
committerGitHub <noreply@github.com>2017-03-07 20:03:12 -0300
commit40f9024b51900c73bc0f65444c16022bd73820be (patch)
tree83c4d2e56491a2b6ae2c2cf2280f8c6293818fbe /docs/tutorial/tutorial.rst
parent2b5648efda40e28ae652ff6c27ac012edda0472e (diff)
parent8d21972c42f07f7bb100ce29db192147e266c561 (diff)
downloadgraphql-40f9024b51900c73bc0f65444c16022bd73820be.tar.gz
Merge pull request #22 from Lupino/master
update docs
Diffstat (limited to 'docs/tutorial/tutorial.rst')
-rw-r--r--docs/tutorial/tutorial.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/tutorial/tutorial.rst b/docs/tutorial/tutorial.rst
index 1c8b5ff..48fc29f 100644
--- a/docs/tutorial/tutorial.rst
+++ b/docs/tutorial/tutorial.rst
@@ -29,6 +29,7 @@ dependencies.
import qualified Data.GraphQL.Schema as Schema
import Control.Applicative
+ import Data.List.NonEmpty (NonEmpty((:|)))
import Data.Text hiding (empty)
import Data.Aeson
import Data.ByteString.Lazy.Char8 (putStrLn)
@@ -48,7 +49,7 @@ First we build a GraphQL schema.
.. code:: haskell
schema1 :: Alternative f => Schema f
- schema1 = Schema [hello]
+ schema1 = hello :| []
hello :: Alternative f => Resolver f
hello = Schema.scalar "hello" ("it's me" :: Text)
@@ -82,7 +83,7 @@ For this example, we're going to be using time.
.. code:: haskell
schema2 :: Schema IO
- schema2 = Schema [time]
+ schema2 = time :| []
time :: Resolver IO
time = Schema.scalarA "time" $ \case
@@ -150,7 +151,7 @@ both.
.. code:: haskell
schema3 :: Schema IO
- schema3 = Schema [hello, time]
+ schema3 = hello :| [time]
query3 :: Text
query3 = "query timeAndHello { time hello }"