How to use the graphql-language-service-types.FileChangeTypeKind.Changed function in graphql-language-service-types

To help you get started, we’ve selected a few graphql-language-service-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql / graphiql / packages / graphql-language-service-server / src / MessageProcessor.js View on Github external
params.changes.map(async change => {
        if (
          change.type === FileChangeTypeKind.Created ||
          change.type === FileChangeTypeKind.Changed
        ) {
          const uri = change.uri;
          const text: string = readFileSync(new URL(uri).pathname).toString();
          const contents = getQueryAndRange(text, uri);

          this._updateFragmentDefinition(uri, contents);
          this._updateObjectTypeDefinition(uri, contents);

          const diagnostics = (await Promise.all(
            contents.map(async ({ query, range }) => {
              const results = await this._languageService.getDiagnostics(
                query,
                uri
              );
              if (results && results.length > 0) {
                return processDiagnosticsMessage(results, query, range);

graphql-language-service-types

Types for building GraphQL language services for IDEs

MIT
Latest version published 2 years ago

Package Health Score

64 / 100
Full package analysis