Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The version headers in this history reflect the versions of Apollo Server itself

## vNEXT

- Nothing yet! Stay tuned.
- Add `document`, `variables`, `headers` as an option in the `ApolloServerPluginLandingPageLocalDefault` plugins. The embedded version of Apollo Sandbox can now use these options as an initial state. [PR #6628](https://github.com/apollographql/apollo-server/pull/6628)

## v3.9.0

Expand Down
48 changes: 47 additions & 1 deletion docs/source/api/plugin/landing-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,52 @@ By default, the landing page displays a footer that links to the documentation t
<tr>
<td>

###### `document`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these get passed through to sandbox in the regular landing page? We were just missing them before but they are supported right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup! they were always in ApolloServerPluginLandingPageDefaultBaseOptions, but just not mentioned in the docs


`string`
</td>
<td>

A GraphQL document (eg, query or mutation) to populate in the Studio Explorer's editor on load.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A GraphQL document (eg, query or mutation) to populate in the Studio Explorer's editor on load.
A GraphQL document (eg, query or mutation) to populate in the Studio Sandbox Explorer's editor on load.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want to add this? This API applies to both sandbox and explorer, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the local dev docs, so they will only ever lead to sandbox afaict

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no strong opinion tho!


If you omit this, the Explorer initially loads an example query based on your schema.

</td>
</tr>

<tr>
<td>

###### `variables`

`Record<string, string | Record>`
</td>
<td>

An object containing initial variable values to populate in the Explorer on load.

If provided, these variables should apply to the initial query you provide in `document`.

</td>
</tr>

<tr>
<td>

###### `headers`

`Record<string, string>`
</td>
<td>

An object containing initial HTTP header values to populate in the Explorer on load.

</td>
</tr>

<tr>
<td>

###### `includeCookies`

`boolean`
Expand Down Expand Up @@ -228,7 +274,7 @@ If you omit this, the Explorer initially loads an example query based on your sc

###### `variables`

`Record<string, string>`
`Record<string, string | Record>`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the right hand side here should just be unknown or any? i mean you can put numbers and bools and lists in variables...

@William010x William010x Jul 8, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ticket was for a new config (initialState) recently added to the embedded-explorer repo. These parameters (document, variables and headers) already existed, but yeah they weren't used or passed through for embedded Sandbox.

The parameters were added and the docs were updated accordingly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this change in #6656

</td>
<td>

Expand Down
182 changes: 182 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"jest-config": "28.1.1",
"jest-junit": "13.2.0",
"jest-mock-random": "1.1.1",
"jest-serializer-html": "^7.1.0",
"js-sha256": "0.9.0",
"koa": "2.13.4",
"koa-router": "10.1.1",
Expand Down
Loading