Skip to content

Commit

Permalink
add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed May 27, 2023
1 parent 9dd00a8 commit 4351ad7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-maps-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vscode-graphql-execution': minor
---

`GraphQLContentProvider.getCurrentHtml` should not return `Promise`
2 changes: 1 addition & 1 deletion packages/vscode-graphql-execution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inline in your code for:
the operation.
2. (If variables are specified in the operation), a dialog will prompt for these
variables
3. Then, the results or network error should appear, voila!
3. Then, the results or network error should appear, voilà!
4. If no endpoints are configured, it will exit early and tell you to define
them.

Expand Down
12 changes: 4 additions & 8 deletions packages/vscode-graphql-execution/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ import {
import { GraphQLContentProvider } from './providers/exec-content';
import { GraphQLCodeLensProvider } from './providers/exec-codelens';
import { ExtractedTemplateLiteral } from './helpers/source';
// import { CustomInitializationFailedHandler } from "./CustomInitializationFailedHandler"

function getConfig() {
return workspace.getConfiguration(
'vscode-graphql-execution',
window.activeTextEditor ? window.activeTextEditor.document.uri : null,
window.activeTextEditor?.document.uri,
);
}

Expand All @@ -27,9 +26,8 @@ export function activate(context: ExtensionContext) {
'GraphQL Operation Execution',
);
const config = getConfig();
const { debug } = config;

if (debug) {
if (config.debug) {
// eslint-disable-next-line no-console
console.log('Extension "vscode-graphql" is now active!');
}
Expand Down Expand Up @@ -72,7 +70,7 @@ export function activate(context: ExtensionContext) {

const commandContentProvider = commands.registerCommand(
'vscode-graphql-execution.contentProvider',
async (literal: ExtractedTemplateLiteral) => {
(literal: ExtractedTemplateLiteral) => {
const uri = Uri.parse('graphql://authority/graphql');

const panel = window.createWebviewPanel(
Expand All @@ -93,9 +91,7 @@ export function activate(context: ExtensionContext) {
contentProvider,
);
context.subscriptions.push(registration);

const html = await contentProvider.getCurrentHtml();
panel.webview.html = html;
panel.webview.html = contentProvider.getCurrentHtml();
},
);
context.subscriptions.push(commandContentProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class GraphQLContentProvider implements TextDocumentContentProvider {

timeout = (ms: number) => new Promise(res => setTimeout(res, ms));

async getCurrentHtml(): Promise<string> {
getCurrentHtml(): string {
return this.html;
}

Expand Down

0 comments on commit 4351ad7

Please sign in to comment.