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 diff --git a/packages/explorer/src/EmbeddedExplorer.ts b/packages/explorer/src/EmbeddedExplorer.ts index 2278cfa9..efcd3f16 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; + runtime?: string; }; let idCounter = 0; @@ -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, diff --git a/packages/sandbox/src/EmbeddedSandbox.ts b/packages/sandbox/src/EmbeddedSandbox.ts index 398fc602..3490fa08 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; + runtime?: string; }; let idCounter = 0; @@ -117,6 +117,7 @@ export class EmbeddedSandbox { } = this.options.initialState || {}; const queryParams = { + runtime: this.options.runtime, endpoint: this.options.initialEndpoint, defaultCollectionId: collectionId, defaultCollectionEntryId: operationId,