Skip to content

Commit

Permalink
installation
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdemarGr committed Oct 11, 2023
1 parent 9dcb394 commit 66bc82c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ It enables succintly exposing and consuming GraphQL APIs in a purely functional

To learn more, check out the [docs.](https://valdemargr.github.io/gql/)

# Installation
gql is available for Scala 2.13 and 3.3.
The available modules are listed on the [modules page](https://valdemargr.github.io/gql/docs/overview/modules).

# Example
```scala
import gql.dsl.all._
Expand All @@ -36,12 +40,11 @@ gql provides descriptive messages in case of query errors.
```graphql
| query MyQuery {
| test.,test
| >>>>>^^^^^^^ line:2, column:16, offset:41, character code code:46
| >>>>>^^^^^^^ line:2, column:16, offset:41, character code:46
| }
```
And also when the schema has been defined incorrectly.
```
// Argument 'myArg' was defined in field 'myField' in type `MyType` but was not defined in interface `MyInterface`. at root.Query.myField
// Invalid field name '0hey', the field name must match /[_A-Za-z][_0-9A-Za-z]*/ at root.Query.0hey
```

8 changes: 6 additions & 2 deletions readme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ It enables succintly exposing and consuming GraphQL APIs in a purely functional

To learn more, check out the [docs.](https://valdemargr.github.io/gql/)

# Installation
gql is available for Scala 2.13 and 3.3.
The available modules are listed on the [modules page](https://valdemargr.github.io/gql/docs/overview/modules).

# Example
```scala mdoc:silent
import gql.dsl.all._
Expand All @@ -36,7 +40,7 @@ gql provides descriptive messages in case of query errors.
```graphql
| query MyQuery {
| test.,test
| >>>>>^^^^^^^ line:2, column:16, offset:41, character code code:46
| >>>>>^^^^^^^ line:2, column:16, offset:41, character code:46
| }
```
And also when the schema has been defined incorrectly.
Expand All @@ -46,4 +50,4 @@ val p1 = gql.Validation.Problem(gql.Validation.Error.ArgumentNotDefinedInInterfa
val c2 = gql.Cursor.empty.field("Query").field("0hey")
val p2 = gql.Validation.Problem(gql.Validation.Error.InvalidFieldName("0hey"), c2)
println(s"""```\n// $p1\n// $p2\n```""")
```
```

0 comments on commit 66bc82c

Please sign in to comment.