Skip to content

Commit 977598e

Browse files
authored
Merge pull request #137 from bakhtiyarneyman/main
A bunch of improvements
2 parents e459880 + 7fa9862 commit 977598e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+236
-102
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ queryGql ::
4444
GqlQuery Nil' OpQuery Schema query returns =>
4545
DecodeJson returns =>
4646
String -> query -> Aff returns
47-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Schema)
47+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Schema)
4848
4949
-- Schema
5050
type Schema
@@ -129,7 +129,7 @@ const { generateSchema } = require('purescript-graphql-client')
129129
generateSchema({
130130
dir: './src/generated', // Where you want the generated code to go
131131
modulePath: ['Generated', 'Gql'], // The name of the generated module
132-
url: 'http://localhost:4000/graphql' // Your graphql enppdint
132+
url: 'http://localhost:4892/graphql' // Your graphql enppdint
133133
})
134134
```
135135

@@ -148,7 +148,7 @@ generateSchemas({
148148
modulePath: ['Generated', 'Gql']
149149
}, [
150150
{
151-
url: 'http://localhost:4000/graphql',
151+
url: 'http://localhost:4892/graphql',
152152
moduleName: 'MySchema' // The name of the module for this single schema
153153
}
154154
])
@@ -187,7 +187,7 @@ import Type.Data.List (Nil')
187187
...
188188
189189
client :: Client _ Nil' Query Mutation Void <- createClient
190-
{ url: "http://localhost:4000/graphql"
190+
{ url: "http://localhost:4892/graphql"
191191
, authToken: Nothing
192192
, headers: []
193193
}
@@ -217,10 +217,10 @@ import Type.Data.List (Nil')
217217
218218
client :: Client _ Nil' Query Mutation Subscription <-
219219
createSubscriptionClient
220-
{ url: "http://localhost:4000/graphql"
220+
{ url: "http://localhost:4892/graphql"
221221
, authToken: Nothing
222222
, headers: []
223-
, websocketUrl: "ws://localhost:4000/subscriptions"
223+
, websocketUrl: "ws://localhost:4892/subscriptions"
224224
}
225225
let
226226
event = subscription client "get_props"
@@ -478,5 +478,3 @@ Although the names and scope of the 2 packages are very similar they are not con
478478
- This package uses record syntax to make queries whereas purescript-graphqlclient uses applicative/ado syntax
479479
- This package allows use of Apollo if you wish (or other lower level graphQL clients)
480480
- This package supports subscriptions, watch queries and client caching
481-
482-

e2e/1-affjax/server-fn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module.exports = (onListening) => {
99
prop: String
1010
widgets(id: Int): [Widget!]!
1111
}
12-
13-
type Widget {
12+
13+
type Widget {
1414
id: Int
1515
name: String!
1616
}
@@ -38,5 +38,5 @@ module.exports = (onListening) => {
3838
graphiql: true
3939
}))
4040

41-
app.listen(4000, onListening)
41+
app.listen(4892, onListening)
4242
}

e2e/1-affjax/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

e2e/1-affjax/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ client
4747
, mutation :: Void
4848
, subscription :: Void
4949
}
50-
client = (Client $ AffjaxNodeClient "http://localhost:4000/graphql" [])
50+
client = (Client $ AffjaxNodeClient "http://localhost:4892/graphql" [])
5151

5252
-- Schema
5353
type Schema =

e2e/2-comments/generate-purs-schema.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default () =>
99
useNewtypesForRecords: true
1010
}, [
1111
{
12-
url: 'http://localhost:4000/graphql',
12+
url: 'http://localhost:4892/graphql',
1313
moduleName: 'Admin'
1414
}
1515
])

e2e/2-comments/server-fn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ module.exports = (onListening) => {
4646
graphiql: true
4747
}))
4848

49-
app.listen(4000, onListening)
49+
app.listen(4892, onListening)
5050
}

e2e/2-comments/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

e2e/2-comments/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ queryGql ::
3434
GqlQuery Nil' OpQuery Query query returns =>
3535
DecodeJson returns =>
3636
String -> query -> Aff returns
37-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Query)
37+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Query)

examples/1-simple/server-fn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module.exports = (onListening) => {
99
prop: String
1010
widgets(id: Int): [Widget!]!
1111
}
12-
13-
type Widget {
12+
13+
type Widget {
1414
id: Int
1515
name: String!
1616
}
@@ -38,5 +38,5 @@ module.exports = (onListening) => {
3838
graphiql: true
3939
}))
4040

41-
app.listen(4000, onListening)
41+
app.listen(4892, onListening)
4242
}

examples/1-simple/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

examples/1-simple/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ queryGql ::
2727
GqlQuery Nil' OpQuery Schema query returns =>
2828
DecodeJson returns =>
2929
String -> query -> Aff returns
30-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Schema)
30+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Schema)
3131

3232
-- Schema
3333
type Schema

examples/10-aliases/server-fn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module.exports = (onListening) => {
99
prop: String
1010
widgets(id: Int): [Widget!]!
1111
}
12-
13-
type Widget {
12+
13+
type Widget {
1414
id: Int
1515
name: String!
1616
}
@@ -38,5 +38,5 @@ module.exports = (onListening) => {
3838
graphiql: true
3939
}))
4040

41-
app.listen(4000, onListening)
41+
app.listen(4892, onListening)
4242
}

examples/10-aliases/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

examples/10-aliases/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ queryGql ::
3939
GqlQuery Nil' OpQuery Schema query returns =>
4040
DecodeJson returns =>
4141
String -> query -> Aff returns
42-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Schema)
42+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Schema)
4343

4444
-- Schema
4545
type Schema

examples/11-unions/generate-purs-schema.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default () =>
99
useNewtypesForRecords: false
1010
}, [
1111
{
12-
url: 'http://localhost:4000/graphql',
12+
url: 'http://localhost:4892/graphql',
1313
moduleName: 'Admin'
1414
}
1515
])

examples/11-unions/server-fn.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = (onListening) => {
3232
height: 1.8,
3333
id: 1,
3434
};
35-
}else {
35+
}else {
3636
return {
3737
__typename: "Droid",
3838
name: "R2D2",
@@ -54,5 +54,5 @@ module.exports = (onListening) => {
5454
})
5555
);
5656

57-
app.listen(4000, onListening);
57+
app.listen(4892, onListening);
5858
};

examples/11-unions/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
require('./server-fn')(() => {
2-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
2+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
33
})

examples/11-unions/spago.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ You can edit this file as you like.
55
{ name = "my-project"
66
, dependencies = ../../test-deps.dhall
77
, packages = ./packages.dhall
8-
, sources = [ "src/**/*.purs", "test/**/*.purs", "../../src/**/*.purs" ]
8+
, sources = [ "src/**/*.purs", "../../src/**/*.purs" ]
99
}

examples/11-unions/src/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import Effect.Aff (Aff, launchAff_)
99
import Effect.Class.Console (logShow)
1010
import Generated.Gql.Schema.Admin (Query)
1111
import GraphQL.Client.Args ((=>>))
12-
import GraphQL.Client.Query (query_)
1312
import GraphQL.Client.Operation (OpQuery)
13+
import GraphQL.Client.Query (query_)
1414
import GraphQL.Client.Types (class GqlQuery)
1515
import GraphQL.Client.Union (GqlUnion(..))
1616
import Type.Data.List (Nil')
@@ -39,4 +39,4 @@ queryGql
3939
=> String
4040
-> query
4141
-> Aff returns
42-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Query)
42+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Query)

examples/12-directives/generate-purs-schema.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default () =>
99
useNewtypesForRecords: false
1010
}, [
1111
{
12-
url: 'http://localhost:4000/graphql',
12+
url: 'http://localhost:4892/graphql',
1313
moduleName: 'Admin'
1414
}
1515
])

examples/12-directives/server-fn.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (onListening) => {
99
directive @cached(
1010
"""measured in seconds"""
1111
ttl: Int = 60
12-
12+
1313
"""refresh the cache entry"""
1414
refresh: Boolean = false
1515
) on QUERY
@@ -18,8 +18,8 @@ module.exports = (onListening) => {
1818
prop: String
1919
widgets(id: Int): [Widget!]!
2020
}
21-
22-
type Widget {
21+
22+
type Widget {
2323
id: Int
2424
name: String!
2525
}
@@ -47,5 +47,5 @@ module.exports = (onListening) => {
4747
graphiql: true
4848
}))
4949

50-
app.listen(4000, onListening)
50+
app.listen(4892, onListening)
5151
}

examples/12-directives/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
require('./server-fn')(() => {
2-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
2+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
33
})

examples/12-directives/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ queryGql ::
2929
GqlQuery Directives OpQuery Query query returns =>
3030
DecodeJson returns =>
3131
String -> query -> Aff returns
32-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Query)
32+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Query)

examples/13-error-boundaries/server-fn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module.exports = (onListening) => {
88
prop: String
99
widgets(id: Int): [Widget!]!
1010
}
11-
12-
type Widget {
11+
12+
type Widget {
1313
id: Int
1414
name: String!
1515
contains_bad_type: BadType
@@ -51,5 +51,5 @@ module.exports = (onListening) => {
5151
})
5252
);
5353

54-
app.listen(4000, onListening);
54+
app.listen(4892, onListening);
5555
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

examples/13-error-boundaries/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ queryGql name_ q = do
5757
client <-
5858
liftEffect
5959
$ createClient
60-
{ url: "http://localhost:4000/graphql"
60+
{ url: "http://localhost:4892/graphql"
6161
, headers: []
6262
}
6363
queryFullRes decodeJson identity (client :: Client UrqlClient { directives :: Proxy Nil', query :: Schema | _ }) name_ q

examples/2-codegen/generate-purs-schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export default () =>
77
dir: './src/generated',
88
modulePath: ['Generated', 'Gql', 'Admin'],
99
useNewtypesForRecords: false,
10-
url: 'http://localhost:4000/graphql'
10+
url: 'http://localhost:4892/graphql'
1111
})

examples/2-codegen/generate-purs-schema.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export default () =>
77
dir: './src/generated',
88
modulePath: ['Generated', 'Gql', 'Admin'],
99
useNewtypesForRecords: false,
10-
url: 'http://localhost:4000/graphql'
10+
url: 'http://localhost:4892/graphql'
1111
})

examples/2-codegen/server-fn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module.exports = (onListening) => {
99
prop: String
1010
widgets(id: ID): [Widget!]!
1111
}
12-
13-
type Widget {
12+
13+
type Widget {
1414
id: ID
1515
int: Int
1616
name: String!
@@ -39,5 +39,5 @@ module.exports = (onListening) => {
3939
graphiql: true
4040
}))
4141

42-
app.listen(4000, onListening)
42+
app.listen(4892, onListening)
4343
}

examples/2-codegen/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

examples/2-codegen/src/Main.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ queryGql ::
3030
GqlQuery Nil' OpQuery Query query returns =>
3131
DecodeJson returns =>
3232
String -> query -> Aff returns
33-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Query)
33+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Query)

examples/3-enums/generate-purs-schema.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default () =>
99
useNewtypesForRecords: false
1010
}, [
1111
{
12-
url: 'http://localhost:4000/graphql',
12+
url: 'http://localhost:4892/graphql',
1313
moduleName: 'Admin'
1414
}
1515
])

examples/3-enums/server-fn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ module.exports = (onListening) => {
4747
graphiql: true
4848
}))
4949

50-
app.listen(4000, onListening)
50+
app.listen(4892, onListening)
5151
}

examples/3-enums/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import serverFn from './server-fn.js'
22
serverFn(() => {
3-
console.info('Running a GraphQL API server at http://localhost:4000/graphql')
3+
console.info('Running a GraphQL API server at http://localhost:4892/graphql')
44
})

examples/3-enums/src/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ main =
2222
{ widgets } <-
2323
queryGql "WidgetColoursWithId1"
2424
{ widgets: { colour: RED } =>> { colour } }
25-
25+
2626
-- Will log [ RED ] as there is one red widget
2727
logShow $ map _.colour widgets
2828

@@ -32,4 +32,4 @@ queryGql ::
3232
GqlQuery Nil' OpQuery Query query returns =>
3333
DecodeJson returns =>
3434
String -> query -> Aff returns
35-
queryGql = query_ "http://localhost:4000/graphql" (Proxy :: Proxy Query)
35+
queryGql = query_ "http://localhost:4892/graphql" (Proxy :: Proxy Query)

0 commit comments

Comments
 (0)