+
404
+
+
Page not found :(
+
The requested page could not be found.
+
diff --git a/docs/Gemfile b/docs/Gemfile
new file mode 100644
index 00000000..3295d057
--- /dev/null
+++ b/docs/Gemfile
@@ -0,0 +1,31 @@
+source "https://rubygems.org"
+
+# Hello! This is where you manage which Jekyll version is used to run.
+# When you want to use a different version, change it below, save the
+# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
+#
+# bundle exec jekyll serve
+#
+# This will help ensure the proper Jekyll version is running.
+# Happy Jekylling!
+gem "jekyll", "~> 3.8.5"
+
+# This is the default theme for new Jekyll sites. You may change this to anything you like.
+gem "minima", "~> 2.0"
+
+# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
+# uncomment the line below. To upgrade, run `bundle update github-pages`.
+# gem "github-pages", group: :jekyll_plugins
+
+# If you have any plugins, put them here!
+group :jekyll_plugins do
+ gem "jekyll-feed", "~> 0.6"
+ gem "just-the-docs"
+end
+
+# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
+gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
+
+# Performance-booster for watching directories on Windows
+gem "wdm", "~> 0.1.0" if Gem.win_platform?
+
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
new file mode 100644
index 00000000..eecc9fc0
--- /dev/null
+++ b/docs/Gemfile.lock
@@ -0,0 +1,79 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ addressable (2.6.0)
+ public_suffix (>= 2.0.2, < 4.0)
+ colorator (1.1.0)
+ concurrent-ruby (1.1.4)
+ em-websocket (0.5.1)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0.6.0)
+ eventmachine (1.2.7)
+ ffi (1.10.0)
+ forwardable-extended (2.6.0)
+ http_parser.rb (0.6.0)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ jekyll (3.8.5)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (~> 0.7)
+ jekyll-sass-converter (~> 1.0)
+ jekyll-watch (~> 2.0)
+ kramdown (~> 1.14)
+ liquid (~> 4.0)
+ mercenary (~> 0.3.3)
+ pathutil (~> 0.9)
+ rouge (>= 1.7, < 4)
+ safe_yaml (~> 1.0)
+ jekyll-feed (0.11.0)
+ jekyll (~> 3.3)
+ jekyll-sass-converter (1.5.2)
+ sass (~> 3.4)
+ jekyll-seo-tag (2.5.0)
+ jekyll (~> 3.3)
+ jekyll-watch (2.1.2)
+ listen (~> 3.0)
+ just-the-docs (0.2.3)
+ jekyll (~> 3.8.5)
+ rake (~> 12.3.1)
+ kramdown (1.17.0)
+ liquid (4.0.1)
+ listen (3.1.5)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ ruby_dep (~> 1.2)
+ mercenary (0.3.6)
+ minima (2.5.0)
+ jekyll (~> 3.5)
+ jekyll-feed (~> 0.9)
+ jekyll-seo-tag (~> 2.1)
+ pathutil (0.16.2)
+ forwardable-extended (~> 2.6)
+ public_suffix (3.0.3)
+ rake (12.3.2)
+ rb-fsevent (0.10.3)
+ rb-inotify (0.10.0)
+ ffi (~> 1.0)
+ rouge (3.3.0)
+ ruby_dep (1.5.0)
+ safe_yaml (1.0.4)
+ sass (3.7.3)
+ sass-listen (~> 4.0.0)
+ sass-listen (4.0.0)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jekyll (~> 3.8.5)
+ jekyll-feed (~> 0.6)
+ just-the-docs
+ minima (~> 2.0)
+ tzinfo-data
+
+BUNDLED WITH
+ 2.0.1
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 00000000..0cdbf8d1
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1,32 @@
+title: KGraphQL
+description: >-
+ Pure Kotlin GraphQL implementation
+baseurl: "/kgraphql/"
+url: "https://apurebase.gitlab.io"
+
+# Build settings
+markdown: kramdown
+theme: "just-the-docs"
+
+permalink: pretty
+
+
+# Just the Docs
+search_enabled: true
+color_scheme: test
+sass:
+ load_paths:
+ - _sass
+aux_links:
+ "KGraphQL on GitHub":
+ - "//github.com/apurebase/kgraphql"
+
+exclude:
+ - Gemfile
+ - Gemfile.lock
+ - node_modules
+ - vendor/bundle/
+ - vendor/cache/
+ - vendor/gems/
+ - vendor/ruby/
+ - any_additional_item # any user-specific listing goes at the end
diff --git a/docs/assets/js/search-data.json b/docs/assets/js/search-data.json
new file mode 100644
index 00000000..1b51d90f
--- /dev/null
+++ b/docs/assets/js/search-data.json
@@ -0,0 +1,12 @@
+---
+---
+{
+{% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
+"id": "{{ forloop.index0 }}",
+"title": "{{ page.title | replace: '&', '&' }}",
+"content": "{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | normalize_whitespace }}",
+"url": "{{ page.url | absolute_url }}",
+"relUrl": "{{ page.url }}"
+}{% unless forloop.last %},{% endunless %}
+{% endif %}{% endfor %}
+}
diff --git a/docs/creating-schema.md b/docs/creating-schema.md
new file mode 100644
index 00000000..0eb131b0
--- /dev/null
+++ b/docs/creating-schema.md
@@ -0,0 +1,13 @@
+---
+layout: default
+title: Creating Schema
+nav_order: 2
+has_children: true
+---
+
+
+`SchemaBuilder` exposes ability to create schema and configure it. Its methods accept closures to configure contained DSL items.
+
+Schema creation is performed by invoking `KGraphQL.schema { ... }`
+
+Every DSL receiver exposes `description: String?` property. Description is visible in introspection system. This property is omitted in documentation for each schema element.
\ No newline at end of file
diff --git a/docs/creating-schema/configuration.md b/docs/creating-schema/configuration.md
new file mode 100644
index 00000000..8ee1a627
--- /dev/null
+++ b/docs/creating-schema/configuration.md
@@ -0,0 +1,30 @@
+---
+layout: default
+title: Configuration
+parent: Creating Schema
+nav_order: 4
+---
+
+KGraphQL schema allows configuration of 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) |
+
+
+*Example*
+
+```kotlin
+KGraphQL.schema {
+ configure {
+ useDefaultPrettyPrinter = true
+ objectMapper = jacksonObjectMapper()
+ useCachingDocumentParser = false
+ }
+}
+```
\ No newline at end of file
diff --git a/docs/creating-schema/deprecation.md b/docs/creating-schema/deprecation.md
new file mode 100644
index 00000000..92b1ea97
--- /dev/null
+++ b/docs/creating-schema/deprecation.md
@@ -0,0 +1,8 @@
+---
+layout: default
+title: Deprecation
+parent: Creating Schema
+nav_order: 3
+---
+
+Schema creator is able to deprecate fields, operations and enum values. DSL builders for those schema elements expose method `deprecate(reason: String)`. Deprecation is visible in schema introspection system with fields `isDeprecated : Boolean` and `deprecationReason: String`.
\ No newline at end of file
diff --git a/docs/creating-schema/operations.md b/docs/creating-schema/operations.md
new file mode 100644
index 00000000..9d6a5a6d
--- /dev/null
+++ b/docs/creating-schema/operations.md
@@ -0,0 +1,59 @@
+---
+layout: default
+title: Operations
+parent: Creating Schema
+nav_order: 1
+---
+
+There are three types of operations that GraphQL models:
+
+* query – a read‐only fetch.
+* mutation – a write followed by a fetch.
+* subscription – a long‐lived request that fetches data in response to source events.
+
+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]({{site.baseurl}}creating-schema/resolver) |
+
+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]({{site.baseurl}}creating-schema/deprecation)
+
+Subscription is not supported yet.
+
+## query { }
+
+`query` allows to create resolver for query operation.
+
+*Example*
+
+```kotlin
+data class Hero(val name : String, val age : Int)
+
+query("hero"){
+ description = "returns formatted name of R2-D2"
+ resolver { -> Hero("R2-D2", 40) }
+}
+```
+
+This example adds query with name hero, which returns new instance of R2-D2 Hero. It can be queried with selection set for name or age, example query: `{hero{name, age}}`
+
+## mutation { }
+`mutation` allows to create resolver for mutation operation.
+
+*Example*
+
+```kotlin
+mutation("createHero"){
+ description = "Creates hero with specified name"
+ resolver { name : String -> name }
+}
+```
+
+This example adds mutation with name `createHero`, which returns passed name.
+
+## subscription { }
+`subscription` operations are not supported yet.
\ No newline at end of file
diff --git a/docs/creating-schema/resolver.md b/docs/creating-schema/resolver.md
new file mode 100644
index 00000000..941ac20d
--- /dev/null
+++ b/docs/creating-schema/resolver.md
@@ -0,0 +1,28 @@
+---
+layout: default
+title: Resolver
+parent: Creating Schema
+nav_order: 5
+---
+
+Resolver is KGraphQL definition of piece of system logic, required to resolve response graph. Operations, Extension Properties and Union Properties accept resolver, which allows schema creator to configure schema behaviour.
+
+Resolver clause accepts kotlin function and returns its DSL item, which is entry point for additional customization of resolver
+
+## withArgs {}
+`withArgs` closure exposes single method `arg`
+
+### arg { }
+`arg` exposes possibility to customize argument default value. Default value is automatically used if query doesn't provide any. it is matched by argument name.
+
+*Example*
+
+```kotlin
+KGraphQL.schema {
+ query("data"){
+ resolver { int: Int, string: String? -> int }.withArgs {
+ arg