-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEBULA-2011: add
hideCookieToggle
option and deprecate `includeCook…
…ies` config option (#215) * update embedded sandbox to deprecate old includeCookies and pass initialCookies and hideCookieToggle from initialState cleanup embedded sandbox cleanup adjust sandbox config * setup embedded explorer to match sandbox and pass through includeCookies to fetch adjust explorer config * make changes backwards compatible * pass includeCookies through to introspection request * adjust embedded explorer based on review * update sandbox based on review * add changeset * Adjust EmbeddedExplorer deprecated text Co-authored-by: mayakoneval <[email protected]> * Update warning text for embedded explorer Co-authored-by: mayakoneval <[email protected]> * Update changelog text Co-authored-by: mayakoneval <[email protected]> * fix lint issue --------- Co-authored-by: mayakoneval <[email protected]>
- Loading branch information
1 parent
1f60f54
commit e542db7
Showing
9 changed files
with
101 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@apollo/explorer': major | ||
'@apollo/sandbox': major | ||
--- | ||
|
||
This major release affects how we send cookies to your embedded Sandbox and embedded Explorer. Previously, when a user passed the `includeCookies` config option we would set cookies on the default `fetch` request. However, when working in Sandbox or Explorer in Studio we let users set `includeCookies` in their connection settings. This change deprecates the old `includeCookies` option and passes the `includeCookies` value set in Explorer to your embedded Explorer or embedded Sandbox. In embedded Sandbox, you can configure whether cookies are initially on or off for your users on first load with the new config option `initialState.includeCookies`. You can decide to show or hide the connection settings toggle for your users with the config option `hideCookieToggle`. This change is backwards compatible, so if you are using the deprecated `includeCookies` config option, that overrides all other config options & your Studio settings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import type { HandleRequest } from './postMessageRelayHelpers'; | ||
|
||
export const defaultHandleRequest = ({ | ||
includeCookies, | ||
legacyIncludeCookies, | ||
}: { | ||
includeCookies: boolean; | ||
legacyIncludeCookies?: boolean; | ||
}): HandleRequest => { | ||
const handleRequestWithCookiePref: HandleRequest = (endpointUrl, options) => | ||
fetch(endpointUrl, { | ||
...options, | ||
...(includeCookies | ||
...(legacyIncludeCookies | ||
? { credentials: 'include' } | ||
: { credentials: 'omit' }), | ||
: // if the user doesn't pass this value then we should use the credentials option sent from the | ||
// studio postMessage request. otherwise this would overwrite it. | ||
legacyIncludeCookies !== undefined | ||
? { credentials: 'omit' } | ||
: {}), | ||
}); | ||
return handleRequestWithCookiePref; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import type { HandleRequest } from './postMessageRelayHelpers'; | ||
|
||
export const defaultHandleRequest = ({ | ||
includeCookies, | ||
legacyIncludeCookies, | ||
}: { | ||
includeCookies: boolean; | ||
legacyIncludeCookies?: boolean; | ||
}): HandleRequest => { | ||
const handleRequestWithCookiePref: HandleRequest = (endpointUrl, options) => | ||
fetch(endpointUrl, { | ||
...options, | ||
...(includeCookies | ||
...(legacyIncludeCookies | ||
? { credentials: 'include' } | ||
: { credentials: 'omit' }), | ||
: // if the user doesn't pass this value then we should use the credentials option sent from the | ||
// studio postMessage request. otherwise this would overwrite it. | ||
legacyIncludeCookies !== undefined | ||
? { credentials: 'omit' } | ||
: {}), | ||
}); | ||
return handleRequestWithCookiePref; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters