Skip to content

Commit

Permalink
docs: Cleanup documentation (#118)
Browse files Browse the repository at this point in the history
Fixes some incorrect links, unused files and incomplete documentation.
  • Loading branch information
stuebingerb authored Dec 5, 2024
2 parents 023de6a + 78c6815 commit f1c0819
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 285 deletions.
2 changes: 1 addition & 1 deletion docs/content/Examples/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Here you can find some example projects using this library:

1. Basic example using the ktor
plugin: [Official Example](https://github.com/stuebingerb/KGraphQL/tree/main/kgraphql-example)
plugin: [Official Example](https://github.com/stuebingerb/KGraphQL/tree/main/examples/ktor)
1. Todo app that allows for nested todos and different scopes: [Todo Tree](https://github.com/MattLangsenkamp/TodoTree)
1. An article about pairing Kotlin and GraphQL together using
http4k [Medium Article](https://medium.com/@pagakrivos/graphql-and-kotlin-e5d17162d169) | [GitHub repo](https://github.com/pagidas/kgraphql-http4k-demo)
Expand Down
8 changes: 4 additions & 4 deletions docs/content/Plugins/ktor.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ test it out directly within the browser.

## Configuration options

The GraphQL feature is extending the standard [KGraphQL configuration](/Reference/configuration) and providing its own
The GraphQL feature is extending the standard [KGraphQL configuration](../Reference/configuration.md) and providing its own
set of configuration as described in the table below.

| Property | Description | Default value |
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| playground | Gives you out of the box access to a [GraphQL playground](https://github.com/graphql/graphiql) | `false` |
| playground | Gives you out of the box access to a [GraphQL playground](https://github.com/graphql/graphiql) | `false` |
| endpoint | This specifies what route will be delivering the GraphQL endpoint. When `playground` is enabled, it will use this endpoint also. | `/graphql` |
| context | Refer to example below | |
| wrap | If you want to wrap the route into something before KGraphQL will install the GraphQL route. You can use this wrapper. See example below for a more in depth on how to use it. | |
| schema | This is where you are defining your schema. Please refer to [KGraphQL References](/Reference/operations) for further documentation on this. | ***required*** |
| schema | This is where you are defining your schema. Please refer to [KGraphQL References](../Reference/operations.md) for further documentation on this. | ***required*** |

### Wrap

Sometimes you would need to wrap your route within something. A good example of this would be the `authenticate`
function provided by [ktor Authentication feature](https://ktor.io/servers/features/authentication.html).
function provided by [ktor Authentication feature](https://ktor.io/docs/server-auth.html).

```kotlin
wrap {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion docs/content/Reference/Type System/enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ val schema = KGraphQL.schema {
}
```

Enum values can be [deprecated](/Reference/deprecation):
Enum values can be [deprecated](../deprecation.md):

*Example*

Expand Down
10 changes: 5 additions & 5 deletions docs/content/Reference/Type System/objects-and-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ customize types. Besides, only member properties are inspected.

**type { }**
`type` method is entry point to Type DSL.
See [Extension Properties](/Reference/Type%20System/objects-and-interfaces/#extension-properties), [Kotlin Properties](/Reference/Type%20System/objects-and-interfaces/#kotlin-properties), [Union Properties](/Reference/Type%20System/objects-and-interfaces/#union-properties).
See [Extension Properties](#extension-properties), [Kotlin Properties](#kotlin-properties), [Union Properties](#union-properties).

*Example*

Expand Down Expand Up @@ -59,7 +59,7 @@ KGraphQL.schema {
## Kotlin Properties

Kotlin properties are automatically inspected during schema creation. Schema DSL allows ignoring
and [deprecation](/Reference/deprecation) of kotlin properties
and [deprecation](../deprecation.md) of kotlin properties

*Example*

Expand All @@ -85,7 +85,7 @@ after main entity is resolved.

## property { }

`property` method accepts [resolver](/Reference/resolver) and can be subject of [deprecation](/Reference/deprecation).
`property` method accepts [resolver](../resolver.md) and can be subject of [deprecation](../deprecation.md).

*Example*

Expand All @@ -104,8 +104,8 @@ KGraphQL.schema {
## Union Properties

As Kotlin does not support unions, union properties have to be explicitly declared in Schema DSL. Creating union
property requires defining [resolver](/Reference/resolver) and return type. Return Type is reference returned by
creation of [union type](/Reference/Type%20System/unions/).
property requires defining [resolver](../resolver.md) and return type. Return Type is reference returned by
creation of [union type](unions.md).

Union type resolver is not type checked. Invalid resolver implementation which would return value of type other than
members of union type will fail in runtime.
Expand Down
24 changes: 14 additions & 10 deletions docs/content/Reference/configuration.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
KGraphQL schema allows configuration of the following properties:

| Property | Description | Default value |
|--------------------------------|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| useDefaultPrettyPrinter | Schema pretty prints JSON reponses | `false` |
| useCachingDocumentParser | Schema caches parsed query documents | `true` |
| documentParserCacheMaximumSize | Schema document cache maximum size | `1000` |
| objectMapper | Schema is using Jackson ObjectMapper from this property | result of `jacksonObjectMapper()` from [jackson-kotlin-module](https://github.com/FasterXML/jackson-module-kotlin) |
| acceptSingleValueAsArray | Schema accepts single argument values as singleton list | `true` |
| coroutineDispatcher | Schema is using CoroutineDispatcher from this property | [CommonPool](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CommonPool.kt) |
| executor | | [Executor.Parallel](https://github.com/aPureBase/KGraphQL/blob/master/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/execution/Executor.kt) |
| genericTypeResolver | Schema is using generic type resolver from this property | [GenericTypeResolver.DEFAULT](https://github.com/aPureBase/KGraphQL/blob/master/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/execution/GenericTypeResolver.kt) |
| Property | Description | Default value |
|--------------------------------|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| useDefaultPrettyPrinter | Schema pretty prints JSON responses | `false` |
| useCachingDocumentParser | Schema caches parsed query documents | `true` |
| documentParserCacheMaximumSize | Schema document cache maximum size | `1000` |
| objectMapper | Schema is using Jackson ObjectMapper from this property | result of `jacksonObjectMapper()` from [jackson-kotlin-module](https://github.com/FasterXML/jackson-module-kotlin) |
| acceptSingleValueAsArray | Schema accepts single argument values as singleton list | `true` |
| coroutineDispatcher | Schema is using CoroutineDispatcher from this property | [CommonPool](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CommonPool.kt) |
| executor | | [Executor.Parallel](https://github.com/aPureBase/KGraphQL/blob/master/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/execution/Executor.kt) |
| genericTypeResolver | Schema is using generic type resolver from this property | [GenericTypeResolver.DEFAULT](https://github.com/aPureBase/KGraphQL/blob/master/kgraphql/src/main/kotlin/com/apurebase/kgraphql/schema/execution/GenericTypeResolver.kt) |
| wrapErrors | | `true` |
| timeout | | `null` |
| introspection | Schema allows introspection (also affects SDL). Introspection can be disabled in production to reduce attack surface. | `true` |
| plugins | (unused?) | |

*Example*

Expand Down
10 changes: 5 additions & 5 deletions docs/content/Reference/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Each operation is represented by an operation name and a selection set.

In KGraphQL, operation is declared in `SchemaBuilder` block. Every operation has 2 properties:

| name | description |
|----------|---------------------------------|
| name | name of operation |
| resolver | [Resolver](/Reference/resolver) |
| name | description |
|----------|-------------------------|
| name | name of operation |
| resolver | [Resolver](resolver.md) |

Selection set is automatically created based on resolver return type. By default, selection set for specific class
contains all its member properties (without extension properties), but it can be customized (TBD Type wiki page).
Operations can be [deprecated](/Reference/deprecation)
Operations can be [deprecated](deprecation.md)

Subscription is not supported yet.

Expand Down
Loading

0 comments on commit f1c0819

Please sign in to comment.