Skip to content

Commit

Permalink
send referrer to studio via query param (#221)
Browse files Browse the repository at this point in the history
* send referrer to studio via query param

* Create breezy-apples-add.md

* rename to runtime
  • Loading branch information
mayakoneval committed Mar 9, 2023
1 parent 2729861 commit 58165cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/breezy-apples-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@apollo/explorer": patch
"@apollo/sandbox": patch
---

send referrer to studio via query param
2 changes: 2 additions & 0 deletions packages/explorer/src/EmbeddedExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export type EmbeddableExplorerOptions =

type InternalEmbeddableExplorerOptions = EmbeddableExplorerOptions & {
__testLocal__?: boolean;
runtime?: string;
};

let idCounter = 0;
Expand Down Expand Up @@ -216,6 +217,7 @@ export class EmbeddedExplorer {
const graphRef =
'graphRef' in this.options ? this.options.graphRef : undefined;
const queryParams = {
runtime: this.options.runtime,
graphRef,
defaultCollectionEntryId: operationId,
defaultCollectionId: collectionId,
Expand Down
3 changes: 2 additions & 1 deletion packages/sandbox/src/EmbeddedSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { JSONObject } from './helpers/types';
export interface EmbeddableSandboxOptions {
target: string | HTMLElement; // HTMLElement is to accommodate people who might prefer to pass in a ref
initialEndpoint?: string;

initialState?: {
document?: string;
variables?: JSONObject;
Expand Down Expand Up @@ -64,6 +63,7 @@ export interface EmbeddableSandboxOptions {
type InternalEmbeddableSandboxOptions = EmbeddableSandboxOptions & {
__testLocal__?: boolean;
initialRequestQueryPlan?: boolean;
runtime?: string;
};

let idCounter = 0;
Expand Down Expand Up @@ -117,6 +117,7 @@ export class EmbeddedSandbox {
} = this.options.initialState || {};

const queryParams = {
runtime: this.options.runtime,
endpoint: this.options.initialEndpoint,
defaultCollectionId: collectionId,
defaultCollectionEntryId: operationId,
Expand Down

0 comments on commit 58165cf

Please sign in to comment.