Skip to content

Commit

Permalink
Deploying to gh-pages from @ b28ada9 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Nov 8, 2024
1 parent 6425daf commit 06768cd
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 100 deletions.
2 changes: 1 addition & 1 deletion HelpTOC.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"entities":{"pages":{"-7a6n2h_2":{"id":"-7a6n2h_2","title":"GitHub","url":"https://github.com/apollographql/apollo-kotlin-execution","level":0,"tabIndex":0},"-7a6n2h_3":{"id":"-7a6n2h_3","title":"Kdoc","url":"https://apollographql.github.io/apollo-kotlin-execution/kdoc","level":0,"tabIndex":1},"-7a6n2h_4":{"id":"-7a6n2h_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":"-7a6n2h_4","tabIndex":0},"schema":{"id":"schema","title":"Generating a schema","url":"schema.html","level":1,"parentId":"-7a6n2h_4","tabIndex":1},"scalars":{"id":"scalars","title":"Custom scalars","url":"scalars.html","level":1,"parentId":"-7a6n2h_4","tabIndex":2},"execution-context":{"id":"execution-context","title":"Execution context","url":"execution-context.html","level":1,"parentId":"-7a6n2h_4","tabIndex":3},"persisted-documents":{"id":"persisted-documents","title":"Persisted documents","url":"persisted-documents.html","level":1,"parentId":"-7a6n2h_4","tabIndex":4},"ide":{"id":"ide","title":"IDE","url":"ide.html","level":1,"parentId":"-7a6n2h_4","tabIndex":5},"schema-dump":{"id":"schema-dump","title":"Monitoring the generated schema","url":"schema-dump.html","level":1,"parentId":"-7a6n2h_4","tabIndex":6},"-7a6n2h_5":{"id":"-7a6n2h_5","title":"Integrations","level":0,"pages":["ktor","http4k","spring"],"tabIndex":3},"ktor":{"id":"ktor","title":"Ktor","url":"ktor.html","level":1,"parentId":"-7a6n2h_5","tabIndex":0},"http4k":{"id":"http4k","title":"http4k","url":"http4k.html","level":1,"parentId":"-7a6n2h_5","tabIndex":1},"spring":{"id":"spring","title":"Spring","url":"spring.html","level":1,"parentId":"-7a6n2h_5","tabIndex":2},"-7a6n2h_6":{"id":"-7a6n2h_6","title":"Apollo Federation","level":0,"pages":["federation"],"tabIndex":4},"federation":{"id":"federation","title":"Apollo Federation","url":"federation.html","level":1,"parentId":"-7a6n2h_6","tabIndex":0},"-7a6n2h_7":{"id":"-7a6n2h_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":"-7a6n2h_7","tabIndex":0}}},"topLevelIds":["-7a6n2h_2","-7a6n2h_3","-7a6n2h_4","-7a6n2h_5","-7a6n2h_6","-7a6n2h_7"]}
{"entities":{"pages":{"oregoy_2":{"id":"oregoy_2","title":"GitHub","url":"https://github.com/apollographql/apollo-kotlin-execution","level":0,"tabIndex":0},"oregoy_3":{"id":"oregoy_3","title":"Kdoc","url":"https://apollographql.github.io/apollo-kotlin-execution/kdoc","level":0,"tabIndex":1},"oregoy_4":{"id":"oregoy_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":"oregoy_4","tabIndex":0},"schema":{"id":"schema","title":"Generating a schema","url":"schema.html","level":1,"parentId":"oregoy_4","tabIndex":1},"scalars":{"id":"scalars","title":"Custom scalars","url":"scalars.html","level":1,"parentId":"oregoy_4","tabIndex":2},"execution-context":{"id":"execution-context","title":"Execution context","url":"execution-context.html","level":1,"parentId":"oregoy_4","tabIndex":3},"persisted-documents":{"id":"persisted-documents","title":"Persisted documents","url":"persisted-documents.html","level":1,"parentId":"oregoy_4","tabIndex":4},"ide":{"id":"ide","title":"IDE","url":"ide.html","level":1,"parentId":"oregoy_4","tabIndex":5},"schema-dump":{"id":"schema-dump","title":"Monitoring the generated schema","url":"schema-dump.html","level":1,"parentId":"oregoy_4","tabIndex":6},"oregoy_5":{"id":"oregoy_5","title":"Integrations","level":0,"pages":["ktor","http4k","spring"],"tabIndex":3},"ktor":{"id":"ktor","title":"Ktor","url":"ktor.html","level":1,"parentId":"oregoy_5","tabIndex":0},"http4k":{"id":"http4k","title":"http4k","url":"http4k.html","level":1,"parentId":"oregoy_5","tabIndex":1},"spring":{"id":"spring","title":"Spring","url":"spring.html","level":1,"parentId":"oregoy_5","tabIndex":2},"oregoy_6":{"id":"oregoy_6","title":"Apollo Federation","level":0,"pages":["federation"],"tabIndex":4},"federation":{"id":"federation","title":"Apollo Federation","url":"federation.html","level":1,"parentId":"oregoy_6","tabIndex":0},"oregoy_7":{"id":"oregoy_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":"oregoy_7","tabIndex":0}}},"topLevelIds":["oregoy_2","oregoy_3","oregoy_4","oregoy_5","oregoy_6","oregoy_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-08T17:23:20.491088004"><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-08T17:26:11.815910417"><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="z84j0dq_3">Kotlin functions may define an additional <code class="code" id="z84j0dq_11">ExecutionContext</code> parameter. This parameter is special and never exposed in GraphQL.</p><div class="table-wrapper"><table class="wide" id="z84j0dq_4"><thead><tr class="ijRowHead" id="z84j0dq_12"><th id="z84j0dq_14"><p>Kotlin</p></th><th id="z84j0dq_15"><p>GraphQL</p></th></tr></thead><tbody><tr id="z84j0dq_13"><td id="z84j0dq_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="z5gahkp_3">Kotlin functions may define an additional <code class="code" id="z5gahkp_11">ExecutionContext</code> parameter. This parameter is special and never exposed in GraphQL.</p><div class="table-wrapper"><table class="wide" id="z5gahkp_4"><thead><tr class="ijRowHead" id="z5gahkp_12"><th id="z5gahkp_14"><p>Kotlin</p></th><th id="z5gahkp_15"><p>GraphQL</p></th></tr></thead><tbody><tr id="z5gahkp_13"><td id="z5gahkp_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="z84j0dq_17"><div class="code-block" data-lang="none">
</div></td><td id="z5gahkp_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="z84j0dq_5"><code class="code" id="z84j0dq_20">ExecutionContext</code> is a typesafe map inspired by <code class="code" id="z84j0dq_21">CoroutinesContext</code>. Define your own context by extending <code class="code" id="z84j0dq_22">ExecutionContext.Element</code>:</p><div class="code-block" data-lang="kotlin">
</div></td></tr></tbody></table></div><p id="z5gahkp_5"><code class="code" id="z5gahkp_20">ExecutionContext</code> is a typesafe map inspired by <code class="code" id="z5gahkp_21">CoroutinesContext</code>. Define your own context by extending <code class="code" id="z5gahkp_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="z84j0dq_7">And pass it to <code class="code" id="z84j0dq_23">ExecutableSchema.execute()</code>:</p><div class="code-block" data-lang="kotlin">
</div><p id="z5gahkp_7">And pass it to <code class="code" id="z5gahkp_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="z84j0dq_9"><code class="code" id="z84j0dq_24">CurrentUser</code> is now available in <code class="code" id="z84j0dq_25">Query.viewer</code>:</p><div class="code-block" data-lang="kotlin">
</div><p id="z5gahkp_9"><code class="code" id="z5gahkp_24">CurrentUser</code> is now available in <code class="code" id="z5gahkp_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 06768cd

Please sign in to comment.