@@ -10,13 +10,13 @@ A typesafe graphql client for purescript.
1010
1111This library will allow you to make graphql queries and type checks the query, arguments and response.
1212
13- It includes functions for making graphql queries and codegen tools for making sure your GraphQL schema and Purescript schema are in sync.
13+ It includes functions for making graphql queries and codegen tools for making sure your GraphQL schema and PureScript schema are in sync.
1414
1515## Example
1616
17- Here is a complete application using purescript-graphql-client, that makes a graphQL query and logs the result, without using schema codegen.
17+ Here is a complete application using purescript-graphql-client, that makes a GraphQL query and logs the result, without using schema codegen.
1818
19- ``` purescript
19+ ``` purs
2020module Main where
2121
2222import Prelude
@@ -94,18 +94,12 @@ name = Proxy
9494
9595### Installation
9696
97- Either use spago (recommended)
97+ Use [ Spago ] ( https://github.com/purescript/spago ) :
9898
99- ```
99+ ``` sh
100100spago install graphql-client
101101```
102102
103- or install with bower
104-
105- ```
106- bower install purescript-graphql-client
107- ```
108-
109103### Schema
110104
111105In order to use this library you will need a Purescript representation of your GraphQL schema.
@@ -118,8 +112,8 @@ It is possible to write the schema yourself but it is easier and safer to use th
118112
119113There is an npm library that is a thin wrapper around this library's schema codegen. First, install this package:
120114
121- ```
122- npm i -D purescript-graphql-client
115+ ``` sh
116+ npm install --save-dev purescript-graphql-client
123117```
124118
125119Then add a script to generate your schema on build. Run this script before compiling your purescript project.
@@ -171,13 +165,14 @@ You can also create your own base client by making your own data type an instanc
171165To use Affjax you can create a base client using the ` AffjaxNodeClient ` data constructor and
172166pass it the url of your GraphQL endpoint and any request headers.
173167
174- To use Apollo you will have to install the Apollo npm module.
175- ```
176- npm i -S @apollo/client
168+ To use Apollo you will have to install the Apollo npm module:
169+
170+ ``` sh
171+ npm install --save @apollo/client
177172```
178173
179174you can then create a client using ` createClient ` . eg.
180- ``` purescript
175+ ``` purs
181176import MySchema (Query, Mutation)
182177import GraphQL.Client.BaseClients.Apollo (createClient)
183178import GraphQL.Client.Query (query)
@@ -205,7 +200,7 @@ Look in `examples/4-mutation` for a complete example.
205200
206201Use ` createSubscriptionClient ` if you want to make subscriptions. eg.
207202
208- ``` purescript
203+ ``` purs
209204import Halogen.Subscription as HS
210205import MySchema (Query, Subscription, Mutation)
211206import GraphQL.Client.BaseClients.Apollo (createSubscriptionClient)
@@ -238,10 +233,10 @@ import Type.Data.List (Nil')
238233
239234### On the server
240235
241- To use this library server-side, you should use the Affjax base client and install xhr2
236+ To use this library server-side, you should use the Affjax base client and install xhr2:
242237
243- ```
244- npm i -S xhr2
238+ ``` sh
239+ npm install --save xhr2
245240```
246241
247242You can see an examples of this in ` examples/1-simple ` and ` e2e/1-affjax ` .
0 commit comments