-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Cristina Shaver <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
7 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 |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import * as languageFeatures from './languageFeatures'; | ||
import type { DocumentNode } from 'graphql'; | ||
import { SchemaResponse } from 'graphql-languageservice'; | ||
|
||
export class MonacoGraphQLApi { | ||
private worker: languageFeatures.WorkerAccessor; | ||
constructor({ accessor }: { accessor: languageFeatures.WorkerAccessor }) { | ||
this.worker = accessor; | ||
} | ||
|
||
async getSchema(): Promise<SchemaResponse> { | ||
getSchema = async () => { | ||
const langWorker = await this.worker(); | ||
return langWorker.getSchemaResponse(); | ||
} | ||
async parse(graphqlString: string): Promise<DocumentNode> { | ||
}; | ||
parse = async (graphqlString: string) => { | ||
const langWorker = await this.worker(); | ||
return langWorker.doParse(graphqlString); | ||
} | ||
}; | ||
} |