Skip to content

Commit

Permalink
sendOperationHeadersInIntrospection config option, default to true (#277
Browse files Browse the repository at this point in the history
)

* sendOperationHeadersInIntrospection config option, default to trues

* Update packages/sandbox/src/EmbeddedSandbox.ts

Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>

* fix this

* Create twelve-hats-burn.md

---------

Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
  • Loading branch information
mayakoneval and trevor-scheer committed Sep 21, 2023
1 parent 7dfce71 commit 5cd64d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-hats-burn.md
@@ -0,0 +1,5 @@
---
"@apollo/sandbox": minor
---

sendOperationHeadersInIntrospection config option, default to true
9 changes: 9 additions & 0 deletions packages/sandbox/src/EmbeddedSandbox.ts
Expand Up @@ -79,6 +79,13 @@ export interface EmbeddableSandboxOptions {
* style injection.
*/
allowDynamicStyles?: boolean;
/**
* Defaults to true, even though our default in hosted Sandbox is false.
* Needed to default to true so that shipped versions particularly on Apollo Server
* maintain backwards compatible behavior. Pass false to exclusively pass shared headers
* to introspection requests.
*/
sendOperationHeadersInIntrospection?: boolean;
}

type InternalEmbeddableSandboxOptions = EmbeddableSandboxOptions & {
Expand Down Expand Up @@ -133,6 +140,8 @@ export class EmbeddedSandbox {
runtime: this.options.runtime,
endpoint: this.options.initialEndpoint,
subscriptionEndpoint: this.options.initialSubscriptionEndpoint,
sendOperationHeadersInIntrospection:
this.options.sendOperationHeadersInIntrospection ?? true,
...(this.options.initialState &&
'collectionId' in this.options.initialState
? {
Expand Down

0 comments on commit 5cd64d9

Please sign in to comment.