graphiql
graphiql copied to clipboard
@graphiql/toolkit: provide re-usable monaco-editor actions
How do we make these re-useable? In some cases, models or other arguments will need to be supplied to generate the actions. we give them some interface that can be used with monaco.addCommand() and/or monaco.addAction(). We can prescribe keybindings but allow users to override them just with a configuration trick
Porting these over from graphiql's added commands:
- execute query/operation (supplying fetcher and three models).
- capable of handling multipart requests and subscriptions
- an alias for the expected graphiql keybinding to trigger completion. command+space is the monaco default.
- merge AST
- fillLeafs by re-using the logic in
fillLeafs.ts. this should happen on a keybinding and not necessarily autocomplete - aliasing these commands across editors if needed https://github.com/graphql/graphiql/blob/main/packages/graphiql/src/utility/commonKeys.ts