diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-05-26 11:13:55 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-05-26 11:13:55 +0200 |
| commit | c06d0b8e95ea4b87eab69da085cb32dbd052c1f0 (patch) | |
| tree | 12bcabe076d873f2676b33c6f510dba566352756 /docs/tutorial | |
| parent | 61dbe6c7280a899b485146aa8557948417e78360 (diff) | |
| download | graphql-c06d0b8e95ea4b87eab69da085cb32dbd052c1f0.tar.gz | |
Add Union and Interface type definitions
Diffstat (limited to 'docs/tutorial')
| -rw-r--r-- | docs/tutorial/tutorial.lhs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorial/tutorial.lhs b/docs/tutorial/tutorial.lhs index e80e8c7..39e151c 100644 --- a/docs/tutorial/tutorial.lhs +++ b/docs/tutorial/tutorial.lhs @@ -40,7 +40,7 @@ First we build a GraphQL schema. > schema1 = Schema queryType Nothing > > queryType :: ObjectType IO -> queryType = ObjectType "Query" Nothing +> queryType = ObjectType "Query" Nothing [] > $ HashMap.singleton "hello" > $ Field Nothing (Out.NamedScalarType string) mempty hello > @@ -75,7 +75,7 @@ For this example, we're going to be using time. > schema2 = Schema queryType2 Nothing > > queryType2 :: ObjectType IO -> queryType2 = ObjectType "Query" Nothing +> queryType2 = ObjectType "Query" Nothing [] > $ HashMap.singleton "time" > $ Field Nothing (Out.NamedScalarType string) mempty time > @@ -139,7 +139,7 @@ Now that we have two resolvers, we can define a schema which uses them both. > schema3 = Schema queryType3 Nothing > > queryType3 :: ObjectType IO -> queryType3 = ObjectType "Query" Nothing $ HashMap.fromList +> queryType3 = ObjectType "Query" Nothing [] $ HashMap.fromList > [ ("hello", Field Nothing (Out.NamedScalarType string) mempty hello) > , ("time", Field Nothing (Out.NamedScalarType string) mempty time) > ] |
