Skip to content

Commit

Permalink
Deploying to gh-pages from @ 3eb44b7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Jan 20, 2025
1 parent e53f9b0 commit aafa4be
Show file tree
Hide file tree
Showing 13 changed files with 98 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":{"-p4b6cf_2":{"id":"-p4b6cf_2","title":"GitHub","url":"https://github.com/apollographql/apollo-kotlin-execution","level":0,"tabIndex":0},"-p4b6cf_3":{"id":"-p4b6cf_3","title":"Kdoc","url":"https://apollographql.github.io/apollo-kotlin-execution/kdoc","level":0,"tabIndex":1},"-p4b6cf_4":{"id":"-p4b6cf_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":"-p4b6cf_4","tabIndex":0},"schema":{"id":"schema","title":"Generating a schema","url":"schema.html","level":1,"parentId":"-p4b6cf_4","tabIndex":1},"scalars":{"id":"scalars","title":"Custom scalars","url":"scalars.html","level":1,"parentId":"-p4b6cf_4","tabIndex":2},"execution-context":{"id":"execution-context","title":"Execution context","url":"execution-context.html","level":1,"parentId":"-p4b6cf_4","tabIndex":3},"persisted-documents":{"id":"persisted-documents","title":"Persisted documents","url":"persisted-documents.html","level":1,"parentId":"-p4b6cf_4","tabIndex":4},"ide":{"id":"ide","title":"IDE","url":"ide.html","level":1,"parentId":"-p4b6cf_4","tabIndex":5},"schema-dump":{"id":"schema-dump","title":"Monitoring the generated schema","url":"schema-dump.html","level":1,"parentId":"-p4b6cf_4","tabIndex":6},"-p4b6cf_5":{"id":"-p4b6cf_5","title":"Integrations","level":0,"pages":["ktor","http4k","spring"],"tabIndex":3},"ktor":{"id":"ktor","title":"Ktor","url":"ktor.html","level":1,"parentId":"-p4b6cf_5","tabIndex":0},"http4k":{"id":"http4k","title":"http4k","url":"http4k.html","level":1,"parentId":"-p4b6cf_5","tabIndex":1},"spring":{"id":"spring","title":"Spring","url":"spring.html","level":1,"parentId":"-p4b6cf_5","tabIndex":2},"-p4b6cf_6":{"id":"-p4b6cf_6","title":"Apollo Federation","level":0,"pages":["federation"],"tabIndex":4},"federation":{"id":"federation","title":"Apollo Federation","url":"federation.html","level":1,"parentId":"-p4b6cf_6","tabIndex":0},"-p4b6cf_7":{"id":"-p4b6cf_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":"-p4b6cf_7","tabIndex":0}}},"topLevelIds":["-p4b6cf_2","-p4b6cf_3","-p4b6cf_4","-p4b6cf_5","-p4b6cf_6","-p4b6cf_7"]}
{"entities":{"pages":{"-brr3k8_2":{"id":"-brr3k8_2","title":"GitHub","url":"https://github.com/apollographql/apollo-kotlin-execution","level":0,"tabIndex":0},"-brr3k8_3":{"id":"-brr3k8_3","title":"Kdoc","url":"https://apollographql.github.io/apollo-kotlin-execution/kdoc","level":0,"tabIndex":1},"-brr3k8_4":{"id":"-brr3k8_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":"-brr3k8_4","tabIndex":0},"schema":{"id":"schema","title":"Generating a schema","url":"schema.html","level":1,"parentId":"-brr3k8_4","tabIndex":1},"scalars":{"id":"scalars","title":"Custom scalars","url":"scalars.html","level":1,"parentId":"-brr3k8_4","tabIndex":2},"execution-context":{"id":"execution-context","title":"Execution context","url":"execution-context.html","level":1,"parentId":"-brr3k8_4","tabIndex":3},"persisted-documents":{"id":"persisted-documents","title":"Persisted documents","url":"persisted-documents.html","level":1,"parentId":"-brr3k8_4","tabIndex":4},"ide":{"id":"ide","title":"IDE","url":"ide.html","level":1,"parentId":"-brr3k8_4","tabIndex":5},"schema-dump":{"id":"schema-dump","title":"Monitoring the generated schema","url":"schema-dump.html","level":1,"parentId":"-brr3k8_4","tabIndex":6},"-brr3k8_5":{"id":"-brr3k8_5","title":"Integrations","level":0,"pages":["ktor","http4k","spring"],"tabIndex":3},"ktor":{"id":"ktor","title":"Ktor","url":"ktor.html","level":1,"parentId":"-brr3k8_5","tabIndex":0},"http4k":{"id":"http4k","title":"http4k","url":"http4k.html","level":1,"parentId":"-brr3k8_5","tabIndex":1},"spring":{"id":"spring","title":"Spring","url":"spring.html","level":1,"parentId":"-brr3k8_5","tabIndex":2},"-brr3k8_6":{"id":"-brr3k8_6","title":"Apollo Federation","level":0,"pages":["federation"],"tabIndex":4},"federation":{"id":"federation","title":"Apollo Federation","url":"federation.html","level":1,"parentId":"-brr3k8_6","tabIndex":0},"-brr3k8_7":{"id":"-brr3k8_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":"-brr3k8_7","tabIndex":0}}},"topLevelIds":["-brr3k8_2","-brr3k8_3","-brr3k8_4","-brr3k8_5","-brr3k8_6","-brr3k8_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="2025-01-20T10:20:39.220952132"><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="2025-01-20T10:28:41.556527493"><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="llf21k_3">Kotlin functions may define an additional <code class="code" id="llf21k_11">ExecutionContext</code> parameter. This parameter is special and never exposed in GraphQL.</p><div class="table-wrapper"><table class="wide" id="llf21k_4"><thead><tr class="ijRowHead" id="llf21k_12"><th id="llf21k_14"><p>Kotlin</p></th><th id="llf21k_15"><p>GraphQL</p></th></tr></thead><tbody><tr id="llf21k_13"><td id="llf21k_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="-pkxe8h_3">Kotlin functions may define an additional <code class="code" id="-pkxe8h_11">ExecutionContext</code> parameter. This parameter is special and never exposed in GraphQL.</p><div class="table-wrapper"><table class="wide" id="-pkxe8h_4"><thead><tr class="ijRowHead" id="-pkxe8h_12"><th id="-pkxe8h_14"><p>Kotlin</p></th><th id="-pkxe8h_15"><p>GraphQL</p></th></tr></thead><tbody><tr id="-pkxe8h_13"><td id="-pkxe8h_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="llf21k_17"><div class="code-block" data-lang="none">
</div></td><td id="-pkxe8h_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="llf21k_5"><code class="code" id="llf21k_20">ExecutionContext</code> is a typesafe map inspired by <code class="code" id="llf21k_21">CoroutinesContext</code>. Define your own context by extending <code class="code" id="llf21k_22">ExecutionContext.Element</code>:</p><div class="code-block" data-lang="kotlin">
</div></td></tr></tbody></table></div><p id="-pkxe8h_5"><code class="code" id="-pkxe8h_20">ExecutionContext</code> is a typesafe map inspired by <code class="code" id="-pkxe8h_21">CoroutinesContext</code>. Define your own context by extending <code class="code" id="-pkxe8h_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="llf21k_7">And pass it to <code class="code" id="llf21k_23">ExecutableSchema.execute()</code>:</p><div class="code-block" data-lang="kotlin">
</div><p id="-pkxe8h_7">And pass it to <code class="code" id="-pkxe8h_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="llf21k_9"><code class="code" id="llf21k_24">CurrentUser</code> is now available in <code class="code" id="llf21k_25">Query.viewer</code>:</p><div class="code-block" data-lang="kotlin">
</div><p id="-pkxe8h_9"><code class="code" id="-pkxe8h_24">CurrentUser</code> is now available in <code class="code" id="-pkxe8h_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 aafa4be

Please sign in to comment.