Skip to content

Commit e339a04

Browse files
committed
Fix CI, clean up readme
1 parent 26c2acc commit e339a04

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

README.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ A typesafe graphql client for purescript.
1010

1111
This 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
2020
module Main where
2121
2222
import 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
100100
spago install graphql-client
101101
```
102102

103-
or install with bower
104-
105-
```
106-
bower install purescript-graphql-client
107-
```
108-
109103
### Schema
110104

111105
In 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

119113
There 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

125119
Then 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
171165
To use Affjax you can create a base client using the `AffjaxNodeClient` data constructor and
172166
pass 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

179174
you can then create a client using `createClient`. eg.
180-
```purescript
175+
```purs
181176
import MySchema (Query, Mutation)
182177
import GraphQL.Client.BaseClients.Apollo (createClient)
183178
import GraphQL.Client.Query (query)
@@ -205,7 +200,7 @@ Look in `examples/4-mutation` for a complete example.
205200

206201
Use `createSubscriptionClient` if you want to make subscriptions. eg.
207202

208-
```purescript
203+
```purs
209204
import Halogen.Subscription as HS
210205
import MySchema (Query, Subscription, Mutation)
211206
import 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

247242
You can see an examples of this in `examples/1-simple` and `e2e/1-affjax` .

examples/7-field-type-overrides/spago.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ package:
77
- prelude
88
test:
99
main: Test.Main
10-
dependencies: []
10+
dependencies:
11+
- argonaut-generic
1112
workspace:
1213
packageSet:
1314
registry: 64.6.0

0 commit comments

Comments
 (0)