Skip to content

Commit

Permalink
Deploying to gh-pages from @ ada12d4 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Nov 8, 2024
1 parent fee95ba commit a22c868
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 98 deletions.
2 changes: 1 addition & 1 deletion HelpTOC.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"entities":{"pages":{"-kyf2c8_2":{"id":"-kyf2c8_2","title":"GitHub","url":"https://github.com/apollographql/apollo-kotlin-execution","level":0,"tabIndex":0},"-kyf2c8_3":{"id":"-kyf2c8_3","title":"Kdoc","url":"https://apollographql.github.io/apollo-kotlin-execution/kdoc","level":0,"tabIndex":1},"-kyf2c8_4":{"id":"-kyf2c8_4","title":"Welcome","level":0,"pages":["getting-started","schema","scalars","execution-context","persisted-documents","ide","schema-dump"],"tabIndex":2},"getting-started":{"id":"getting-started","title":"Getting started","url":"getting-started.html","level":1,"parentId":"-kyf2c8_4","tabIndex":0},"schema":{"id":"schema","title":"Generating a schema","url":"schema.html","level":1,"parentId":"-kyf2c8_4","tabIndex":1},"scalars":{"id":"scalars","title":"Custom scalars","url":"scalars.html","level":1,"parentId":"-kyf2c8_4","tabIndex":2},"execution-context":{"id":"execution-context","title":"Execution context","url":"execution-context.html","level":1,"parentId":"-kyf2c8_4","tabIndex":3},"persisted-documents":{"id":"persisted-documents","title":"Persisted documents","url":"persisted-documents.html","level":1,"parentId":"-kyf2c8_4","tabIndex":4},"ide":{"id":"ide","title":"GraphQL IDE","url":"ide.html","level":1,"parentId":"-kyf2c8_4","tabIndex":5},"schema-dump":{"id":"schema-dump","title":"Monitoring the generated schema","url":"schema-dump.html","level":1,"parentId":"-kyf2c8_4","tabIndex":6},"-kyf2c8_5":{"id":"-kyf2c8_5","title":"Integrations","level":0,"pages":["ktor","http4k","spring"],"tabIndex":3},"ktor":{"id":"ktor","title":"Ktor","url":"ktor.html","level":1,"parentId":"-kyf2c8_5","tabIndex":0},"http4k":{"id":"http4k","title":"http4k","url":"http4k.html","level":1,"parentId":"-kyf2c8_5","tabIndex":1},"spring":{"id":"spring","title":"Spring","url":"spring.html","level":1,"parentId":"-kyf2c8_5","tabIndex":2},"-kyf2c8_6":{"id":"-kyf2c8_6","title":"Apollo Federation","level":0,"pages":["federation"],"tabIndex":4},"federation":{"id":"federation","title":"Apollo Federation","url":"federation.html","level":1,"parentId":"-kyf2c8_6","tabIndex":0},"-kyf2c8_7":{"id":"-kyf2c8_7","title":"Apollo Usage Reporting","level":0,"pages":["usage-reporting"],"tabIndex":5},"usage-reporting":{"id":"usage-reporting","title":"Apollo Usage Reporting","url":"usage-reporting.html","level":1,"parentId":"-kyf2c8_7","tabIndex":0}}},"topLevelIds":["-kyf2c8_2","-kyf2c8_3","-kyf2c8_4","-kyf2c8_5","-kyf2c8_6","-kyf2c8_7"]}
{"entities":{"pages":{"n7tosx_2":{"id":"n7tosx_2","title":"GitHub","url":"https://github.com/apollographql/apollo-kotlin-execution","level":0,"tabIndex":0},"n7tosx_3":{"id":"n7tosx_3","title":"Kdoc","url":"https://apollographql.github.io/apollo-kotlin-execution/kdoc","level":0,"tabIndex":1},"n7tosx_4":{"id":"n7tosx_4","title":"Welcome","level":0,"pages":["getting-started","schema","scalars","execution-context","persisted-documents","ide","schema-dump"],"tabIndex":2},"getting-started":{"id":"getting-started","title":"Getting started","url":"getting-started.html","level":1,"parentId":"n7tosx_4","tabIndex":0},"schema":{"id":"schema","title":"Generating a schema","url":"schema.html","level":1,"parentId":"n7tosx_4","tabIndex":1},"scalars":{"id":"scalars","title":"Custom scalars","url":"scalars.html","level":1,"parentId":"n7tosx_4","tabIndex":2},"execution-context":{"id":"execution-context","title":"Execution context","url":"execution-context.html","level":1,"parentId":"n7tosx_4","tabIndex":3},"persisted-documents":{"id":"persisted-documents","title":"Persisted documents","url":"persisted-documents.html","level":1,"parentId":"n7tosx_4","tabIndex":4},"ide":{"id":"ide","title":"GraphQL IDE","url":"ide.html","level":1,"parentId":"n7tosx_4","tabIndex":5},"schema-dump":{"id":"schema-dump","title":"Monitoring the generated schema","url":"schema-dump.html","level":1,"parentId":"n7tosx_4","tabIndex":6},"n7tosx_5":{"id":"n7tosx_5","title":"Integrations","level":0,"pages":["ktor","http4k","spring"],"tabIndex":3},"ktor":{"id":"ktor","title":"Ktor","url":"ktor.html","level":1,"parentId":"n7tosx_5","tabIndex":0},"http4k":{"id":"http4k","title":"http4k","url":"http4k.html","level":1,"parentId":"n7tosx_5","tabIndex":1},"spring":{"id":"spring","title":"Spring","url":"spring.html","level":1,"parentId":"n7tosx_5","tabIndex":2},"n7tosx_6":{"id":"n7tosx_6","title":"Apollo Federation","level":0,"pages":["federation"],"tabIndex":4},"federation":{"id":"federation","title":"Apollo Federation","url":"federation.html","level":1,"parentId":"n7tosx_6","tabIndex":0},"n7tosx_7":{"id":"n7tosx_7","title":"Apollo Usage Reporting","level":0,"pages":["usage-reporting"],"tabIndex":5},"usage-reporting":{"id":"usage-reporting","title":"Apollo Usage Reporting","url":"usage-reporting.html","level":1,"parentId":"n7tosx_7","tabIndex":0}}},"topLevelIds":["n7tosx_2","n7tosx_3","n7tosx_4","n7tosx_5","n7tosx_6","n7tosx_7"]}
12 changes: 6 additions & 6 deletions execution-context.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="robots" content="noindex"><meta name="built-on" content="2024-11-08T01:27:40.743284686"><title>Execution context | Apollo Kotlin Execution</title><script type="application/json" id="virtual-toc-data">[]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b408/app.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="16x16" href="images/favicon-96x96.png"><link rel="icon" type="image/png" sizes="32x32" href="images/favicon-192x192.png"><meta name="image" content=""><!-- Open Graph --><meta property="og:title" content="Execution context | Apollo Kotlin Execution"><meta property="og:description" content=""><meta property="og:image" content=""><meta property="og:site_name" content="Apollo Kotlin Execution Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="writerside-documentation/execution-context.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content=""><meta name="twitter:title" content="Execution context | Apollo Kotlin Execution"><meta name="twitter:description" content=""><meta name="twitter:creator" content=""><meta name="twitter:image:src" content=""><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="robots" content="noindex"><meta name="built-on" content="2024-11-08T09:32:35.763265282"><title>Execution context | Apollo Kotlin Execution</title><script type="application/json" id="virtual-toc-data">[]</script><script type="application/json" id="topic-shortcuts"></script><link href="https://resources.jetbrains.com/writerside/apidoc/6.10.0-b408/app.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="16x16" href="images/favicon-96x96.png"><link rel="icon" type="image/png" sizes="32x32" href="images/favicon-192x192.png"><meta name="image" content=""><!-- Open Graph --><meta property="og:title" content="Execution context | Apollo Kotlin Execution"><meta property="og:description" content=""><meta property="og:image" content=""><meta property="og:site_name" content="Apollo Kotlin Execution Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="writerside-documentation/execution-context.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content=""><meta name="twitter:title" content="Execution context | Apollo Kotlin Execution"><meta name="twitter:description" content=""><meta name="twitter:creator" content=""><meta name="twitter:image:src" content=""><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "WebPage",
"@id": "writerside-documentation/execution-context.html#webpage",
Expand All @@ -13,27 +13,27 @@
"@id": "writerside-documentation/#website",
"url": "writerside-documentation/",
"name": "Apollo Kotlin Execution Help"
}</script><!-- End Schema.org --></head><body data-id="execution-context" data-main-title="Execution context" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="Welcome" data-edit-url="https://github.com/apollographql/apollo-kotlin-execution/edit/main/Writerside/topics/execution-context.md"><div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>Apollo Kotlin Execution Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="execution-context" id="execution-context.md">Execution context</h1><p id="huu6sf_3">Kotlin functions may define an additional <code class="code" id="huu6sf_11">ExecutionContext</code> parameter. This parameter is special and never exposed in GraphQL.</p><div class="table-wrapper"><table class="wide" id="huu6sf_4"><thead><tr class="ijRowHead" id="huu6sf_12"><th id="huu6sf_14"><p>Kotlin</p></th><th id="huu6sf_15"><p>GraphQL</p></th></tr></thead><tbody><tr id="huu6sf_13"><td id="huu6sf_16"><div class="code-block" data-lang="kotlin">
}</script><!-- End Schema.org --></head><body data-id="execution-context" data-main-title="Execution context" data-article-props="{&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="Welcome" data-edit-url="https://github.com/apollographql/apollo-kotlin-execution/edit/main/Writerside/topics/execution-context.md"><div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>Apollo Kotlin Execution Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="execution-context" id="execution-context.md">Execution context</h1><p id="-sfe2pk_3">Kotlin functions may define an additional <code class="code" id="-sfe2pk_11">ExecutionContext</code> parameter. This parameter is special and never exposed in GraphQL.</p><div class="table-wrapper"><table class="wide" id="-sfe2pk_4"><thead><tr class="ijRowHead" id="-sfe2pk_12"><th id="-sfe2pk_14"><p>Kotlin</p></th><th id="-sfe2pk_15"><p>GraphQL</p></th></tr></thead><tbody><tr id="-sfe2pk_13"><td id="-sfe2pk_16"><div class="code-block" data-lang="kotlin">
@GraphQLQuery
class Query {
fun viewer(context: ExecutionContext): User {
// Do something with context
return user
}
}
</div></td><td id="huu6sf_17"><div class="code-block" data-lang="none">
</div></td><td id="-sfe2pk_17"><div class="code-block" data-lang="none">
type Query {
# this field has no arguments
viewer: user
}
</div></td></tr></tbody></table></div><p id="huu6sf_5"><code class="code" id="huu6sf_20">ExecutionContext</code> is a typesafe map inspired by <code class="code" id="huu6sf_21">CoroutinesContext</code>. Define your own context by extending <code class="code" id="huu6sf_22">ExecutionContext.Element</code>:</p><div class="code-block" data-lang="kotlin">
</div></td></tr></tbody></table></div><p id="-sfe2pk_5"><code class="code" id="-sfe2pk_20">ExecutionContext</code> is a typesafe map inspired by <code class="code" id="-sfe2pk_21">CoroutinesContext</code>. Define your own context by extending <code class="code" id="-sfe2pk_22">ExecutionContext.Element</code>:</p><div class="code-block" data-lang="kotlin">
class CurrentUser(val id: String) : ExecutionContext.Element {
override val key: ExecutionContext.Key&lt;*&gt;
get() = Key

companion object Key : ExecutionContext.Key&lt;CurrentUser&gt;
}
</div><p id="huu6sf_7">And pass it to <code class="code" id="huu6sf_23">ExecutableSchema.execute()</code>:</p><div class="code-block" data-lang="kotlin">
</div><p id="-sfe2pk_7">And pass it to <code class="code" id="-sfe2pk_23">ExecutableSchema.execute()</code>:</p><div class="code-block" data-lang="kotlin">
// Get the current logged-in user
val context = CurrentUser(getUserIdFromHttpHeaders())

Expand All @@ -43,7 +43,7 @@
.build(),
context
)
</div><p id="huu6sf_9"><code class="code" id="huu6sf_24">CurrentUser</code> is now available in <code class="code" id="huu6sf_25">Query.viewer</code>:</p><div class="code-block" data-lang="kotlin">
</div><p id="-sfe2pk_9"><code class="code" id="-sfe2pk_24">CurrentUser</code> is now available in <code class="code" id="-sfe2pk_25">Query.viewer</code>:</p><div class="code-block" data-lang="kotlin">
class Query {
fun viewer(context: ExecutionContext): User {
val id = context[CurrentUser]!!.id
Expand Down
Loading

0 comments on commit a22c868

Please sign in to comment.