-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEBULA-2126: Add new config options to Sandbox & Explorer landing pag…
…es (#7431) In the Apollo Server Landing Page Local config, you can now automatically turn off autopolling on your endpoints as well as pass headers used to introspect your schema, embed an operation from a collection, and configure whether the endpoint input box is editable. In the Apollo Server Landing Page Prod config, you can embed an operation from a collection & we fixed a bug introduced in v4.4.0. Example of all new config options: ``` const server = new ApolloServer({ typeDefs, resolvers, plugins: [ process.env.NODE_ENV === 'production' ? ApolloServerPluginLandingPageProductionDefault({ graphRef: 'my-graph-id@my-graph-variant', collectionId: 'abcdef', operationId: '12345' embed: true, footer: false, }) : ApolloServerPluginLandingPageLocalDefault({ collectionId: 'abcdef', operationId: '12345' embed: { initialState: { pollForSchemaUpdates: false, sharedHeaders: { "HeaderNeededForIntrospection": "ValueForIntrospection" }, }, endpointIsEditable: true, }, footer: false, }), ], }); ```
- Loading branch information
1 parent
b694bb1
commit 7cc163a
Showing
6 changed files
with
418 additions
and
73 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,39 @@ | ||
--- | ||
'@apollo/server': minor | ||
--- | ||
|
||
In the Apollo Server Landing Page Local config, you can now automatically turn off autopolling on your endpoints as well as pass headers used to introspect your schema, embed an operation from a collection, and configure whether the endpoint input box is editable. In the Apollo Server Landing Page Prod config, you can embed an operation from a collection & we fixed a bug introduced in release 4.4.0 | ||
|
||
Example of all new config options: | ||
|
||
``` | ||
const server = new ApolloServer({ | ||
typeDefs, | ||
resolvers, | ||
plugins: [ | ||
process.env.NODE_ENV === 'production' | ||
? ApolloServerPluginLandingPageProductionDefault({ | ||
graphRef: 'my-graph-id@my-graph-variant', | ||
collectionId: 'abcdef', | ||
operationId: '12345' | ||
embed: true, | ||
footer: false, | ||
}) | ||
: ApolloServerPluginLandingPageLocalDefault({ | ||
collectionId: 'abcdef', | ||
operationId: '12345' | ||
embed: { | ||
initialState: { | ||
pollForSchemaUpdates: false, | ||
sharedHeaders: { | ||
"HeaderNeededForIntrospection": "ValueForIntrospection" | ||
}, | ||
}, | ||
endpointIsEditable: true, | ||
}, | ||
footer: false, | ||
}), | ||
], | ||
}); | ||
``` |
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
Oops, something went wrong.