GraphiQL API Documentation
    Preparing search index...
    interface ServerOptions {
        config?: GraphQLConfig;
        configDir?: string;
        debug?: true;
        encoding?: "utf-8" | "ascii";
        extensions?: GraphQLExtensionDeclaration[];
        fileExtensions?: readonly (
            | ".js"
            | ".cjs"
            | ".mjs"
            | ".es"
            | ".esm"
            | ".es6"
            | ".ts"
            | ".jsx"
            | ".tsx"
            | ".vue"
            | ".svelte"
            | ".astro"
            | ".cts"
            | ".mts"
        )[];
        graphqlFileExtensions?: string[];
        hostname?: string;
        loadConfigOptions?: LoadConfigOptions;
        method?: "socket"
        | "stream"
        | "node";
        parser?: (
            text: string,
            uri: string,
            fileExtensions?: readonly (
                | ".js"
                | ".cjs"
                | ".mjs"
                | ".es"
                | ".esm"
                | ".es6"
                | ".ts"
                | ".jsx"
                | ".tsx"
                | ".vue"
                | ".svelte"
                | ".astro"
                | ".cts"
                | ".mts"
            )[],
            graphQLFileExtensions?: string[],
            logger?: Logger | NoopLogger,
        ) => Promise<CachedContent[]>;
        port?: number;
        tmpDir?: string;
    }
    Index

    Properties

    config?: GraphQLConfig

    pre-existing GraphQLConfig primitive, to override loadConfigOptions and related deprecated fields

    configDir?: string

    use loadConfigOptions.rootDir now) the directory where graphql-config is found

    debug?: true

    debug mode

    same as with the client reference implementation, the debug setting controls logging output this allows all logger.info() messages to come through. by default, the highest level is warn

    encoding?: "utf-8" | "ascii"

    (socket only) encoding for the LSP server to use.

    'utf-8'
    

    use loadConfigOptions.extensions

    fileExtensions?: readonly (
        | ".js"
        | ".cjs"
        | ".mjs"
        | ".es"
        | ".esm"
        | ".es6"
        | ".ts"
        | ".jsx"
        | ".tsx"
        | ".vue"
        | ".svelte"
        | ".astro"
        | ".cts"
        | ".mts"
    )[]

    allowed file extensions for embedded graphql, used by the parser. note that with vscode, this is also controlled by manifest and client configurations. do not put full-file graphql extensions here!

    ['.js', '.jsx', '.tsx', '.ts', '.mjs']
    
    graphqlFileExtensions?: string[]

    allowed file extensions for full-file graphql, used by the parser.

    ['graphql', 'graphqls', 'gql'  ]
    
    hostname?: string

    (socket only) hostname for the LSP server to run on.

    '127.0.0.1'
    
    loadConfigOptions?: LoadConfigOptions

    LoadConfigOptions from graphql-config@3 to use when we loadConfig() uses process.cwd() by default for rootDir option. you can also pass explicit filepath, add extensions, etc

    method?: "socket" | "stream" | "node"

    socket, streams, or node (ipc).

    'node'
    
    parser?: (
        text: string,
        uri: string,
        fileExtensions?: readonly (
            | ".js"
            | ".cjs"
            | ".mjs"
            | ".es"
            | ".esm"
            | ".es6"
            | ".ts"
            | ".jsx"
            | ".tsx"
            | ".vue"
            | ".svelte"
            | ".astro"
            | ".cts"
            | ".mts"
        )[],
        graphQLFileExtensions?: string[],
        logger?: Logger | NoopLogger,
    ) => Promise<CachedContent[]>

    custom, multi-language parser used by the LSP server. detects extension from uri and decides how to parse it. uses graphql.parse() by default response format is designed to assist with developing LSP tooling around embedded language support

    Type Declaration

      • (
            text: string,
            uri: string,
            fileExtensions?: readonly (
                | ".js"
                | ".cjs"
                | ".mjs"
                | ".es"
                | ".esm"
                | ".es6"
                | ".ts"
                | ".jsx"
                | ".tsx"
                | ".vue"
                | ".svelte"
                | ".astro"
                | ".cts"
                | ".mts"
            )[],
            graphQLFileExtensions?: string[],
            logger?: Logger | NoopLogger,
        ): Promise<CachedContent[]>
      • Helper functions to perform requested services from client/server.

        Parameters

        • text: string
        • uri: string
        • fileExtensions: readonly (
              | ".js"
              | ".cjs"
              | ".mjs"
              | ".es"
              | ".esm"
              | ".es6"
              | ".ts"
              | ".jsx"
              | ".tsx"
              | ".vue"
              | ".svelte"
              | ".astro"
              | ".cts"
              | ".mts"
          )[] = DEFAULT_SUPPORTED_EXTENSIONS
        • graphQLFileExtensions: string[] = DEFAULT_SUPPORTED_GRAPHQL_EXTENSIONS
        • logger: Logger | NoopLogger = ...

        Returns Promise<CachedContent[]>

    port?: number

    (socket only) port for the LSP server to run on. required if using method socket

    tmpDir?: string

    the temporary directory that the server writes to for logs and caching schema