forked from OSS/graphql
Collect types once the schema is created
This commit is contained in:
@ -39,7 +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 queryType
|
||||
> schema1 = schema queryType Nothing Nothing mempty
|
||||
>
|
||||
> queryType :: ObjectType IO
|
||||
> queryType = ObjectType "Query" Nothing []
|
||||
@ -76,7 +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 queryType2
|
||||
> schema2 = schema queryType2 Nothing Nothing mempty
|
||||
>
|
||||
> queryType2 :: ObjectType IO
|
||||
> queryType2 = ObjectType "Query" Nothing []
|
||||
@ -113,7 +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 queryType3
|
||||
> schema3 = schema queryType3 Nothing Nothing mempty
|
||||
>
|
||||
> queryType3 :: ObjectType IO
|
||||
> queryType3 = ObjectType "Query" Nothing [] $ HashMap.fromList
|
||||
|
Reference in New Issue
Block a user