From 02d4966cead900564184a63696eafd234ed665c0 Mon Sep 17 00:00:00 2001 From: Maya Koneval Date: Wed, 8 Mar 2023 09:38:12 -0800 Subject: [PATCH 1/3] send referrer to studio via query param --- packages/explorer/src/EmbeddedExplorer.ts | 2 ++ packages/sandbox/src/EmbeddedSandbox.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/explorer/src/EmbeddedExplorer.ts b/packages/explorer/src/EmbeddedExplorer.ts index 2278cfa9..50d51389 100644 --- a/packages/explorer/src/EmbeddedExplorer.ts +++ b/packages/explorer/src/EmbeddedExplorer.ts @@ -81,6 +81,7 @@ export type EmbeddableExplorerOptions = type InternalEmbeddableExplorerOptions = EmbeddableExplorerOptions & { __testLocal__?: boolean; + referrer?: string; }; let idCounter = 0; @@ -216,6 +217,7 @@ export class EmbeddedExplorer { const graphRef = 'graphRef' in this.options ? this.options.graphRef : undefined; const queryParams = { + referrer: this.options.referrer, graphRef, defaultCollectionEntryId: operationId, defaultCollectionId: collectionId, diff --git a/packages/sandbox/src/EmbeddedSandbox.ts b/packages/sandbox/src/EmbeddedSandbox.ts index 398fc602..7a70a75f 100644 --- a/packages/sandbox/src/EmbeddedSandbox.ts +++ b/packages/sandbox/src/EmbeddedSandbox.ts @@ -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; @@ -64,6 +63,7 @@ export interface EmbeddableSandboxOptions { type InternalEmbeddableSandboxOptions = EmbeddableSandboxOptions & { __testLocal__?: boolean; initialRequestQueryPlan?: boolean; + referrer?: string; }; let idCounter = 0; @@ -117,6 +117,7 @@ export class EmbeddedSandbox { } = this.options.initialState || {}; const queryParams = { + referrer: this.options.referrer, endpoint: this.options.initialEndpoint, defaultCollectionId: collectionId, defaultCollectionEntryId: operationId, From ecc39c358eefd54312ba9d85d04dcb81604910a8 Mon Sep 17 00:00:00 2001 From: mayakoneval Date: Wed, 8 Mar 2023 09:39:01 -0800 Subject: [PATCH 2/3] Create breezy-apples-add.md --- .changeset/breezy-apples-add.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/breezy-apples-add.md diff --git a/.changeset/breezy-apples-add.md b/.changeset/breezy-apples-add.md new file mode 100644 index 00000000..58117d05 --- /dev/null +++ b/.changeset/breezy-apples-add.md @@ -0,0 +1,6 @@ +--- +"@apollo/explorer": patch +"@apollo/sandbox": patch +--- + +send referrer to studio via query param From 9615e2022c972bd921484be0c63ca616e566abe3 Mon Sep 17 00:00:00 2001 From: Maya Koneval Date: Wed, 8 Mar 2023 15:23:37 -0800 Subject: [PATCH 3/3] rename to runtime --- packages/explorer/src/EmbeddedExplorer.ts | 4 ++-- packages/sandbox/src/EmbeddedSandbox.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/explorer/src/EmbeddedExplorer.ts b/packages/explorer/src/EmbeddedExplorer.ts index 50d51389..efcd3f16 100644 --- a/packages/explorer/src/EmbeddedExplorer.ts +++ b/packages/explorer/src/EmbeddedExplorer.ts @@ -81,7 +81,7 @@ export type EmbeddableExplorerOptions = type InternalEmbeddableExplorerOptions = EmbeddableExplorerOptions & { __testLocal__?: boolean; - referrer?: string; + runtime?: string; }; let idCounter = 0; @@ -217,7 +217,7 @@ export class EmbeddedExplorer { const graphRef = 'graphRef' in this.options ? this.options.graphRef : undefined; const queryParams = { - referrer: this.options.referrer, + runtime: this.options.runtime, graphRef, defaultCollectionEntryId: operationId, defaultCollectionId: collectionId, diff --git a/packages/sandbox/src/EmbeddedSandbox.ts b/packages/sandbox/src/EmbeddedSandbox.ts index 7a70a75f..3490fa08 100644 --- a/packages/sandbox/src/EmbeddedSandbox.ts +++ b/packages/sandbox/src/EmbeddedSandbox.ts @@ -63,7 +63,7 @@ export interface EmbeddableSandboxOptions { type InternalEmbeddableSandboxOptions = EmbeddableSandboxOptions & { __testLocal__?: boolean; initialRequestQueryPlan?: boolean; - referrer?: string; + runtime?: string; }; let idCounter = 0; @@ -117,7 +117,7 @@ export class EmbeddedSandbox { } = this.options.initialState || {}; const queryParams = { - referrer: this.options.referrer, + runtime: this.options.runtime, endpoint: this.options.initialEndpoint, defaultCollectionId: collectionId, defaultCollectionEntryId: operationId,