diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-09-29 06:21:32 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-09-29 06:21:32 +0200 |
| commit | 466416d4b00ab48aaab36eea9623a8aaad366fa8 (patch) | |
| tree | 409d86ca6d6851b8b84f8e1099e076a5d0692682 /docs/tutorial/tutorial.lhs | |
| parent | 4602eb1df3a713989b155f0140ff8909eb0370cf (diff) | |
| download | graphql-466416d4b00ab48aaab36eea9623a8aaad366fa8.tar.gz | |
Validate directives are defined
Diffstat (limited to 'docs/tutorial/tutorial.lhs')
| -rw-r--r-- | docs/tutorial/tutorial.lhs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/docs/tutorial/tutorial.lhs b/docs/tutorial/tutorial.lhs index dc44c1e..6a68e35 100644 --- a/docs/tutorial/tutorial.lhs +++ b/docs/tutorial/tutorial.lhs @@ -39,8 +39,7 @@ Now, as our first example, we are going to look at the example from First we build a GraphQL schema. > schema1 :: Schema IO -> schema1 = Schema -> { query = queryType , mutation = Nothing , subscription = Nothing } +> schema1 = schema queryType > > queryType :: ObjectType IO > queryType = ObjectType "Query" Nothing [] @@ -77,8 +76,7 @@ This runs the query by fetching the one field defined, returning For this example, we're going to be using time. > schema2 :: Schema IO -> schema2 = Schema -> { query = queryType2, mutation = Nothing, subscription = Nothing } +> schema2 = schema queryType2 > > queryType2 :: ObjectType IO > queryType2 = ObjectType "Query" Nothing [] @@ -115,8 +113,7 @@ This runs the query, returning the current time Now that we have two resolvers, we can define a schema which uses them both. > schema3 :: Schema IO -> schema3 = Schema -> { query = queryType3, mutation = Nothing, subscription = Nothing } +> schema3 = schema queryType3 > > queryType3 :: ObjectType IO > queryType3 = ObjectType "Query" Nothing [] $ HashMap.fromList |
