Skip to content

"UrlLoader" does not exist in type "LoaderOption".ts #2213

@PaulRBerg

Description

@PaulRBerg

I was following the docs on schema loading, trying to use the URL loader like this:

import type { ConfigOptions } from "@graphql-markdown/types";

const graphqlMarkdown: [string, GraphQLMarkdownOptions] = [
  "@graphql-markdown/docusaurus",
  {
    baseURL: ".",
    loaders: {
      UrlLoader: {
        module: "@graphql-tools/url-loader",
        options: {
          headers: {
            Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
          },
        },
      },
    },
    pretty: true,
    rootPath: "./schema",
    schema: "https://indexer.hyperindex.xyz/3b4ea6b/v1/graphql",
  } satisfies ConfigOptions,
];

But the code doesn't work. I am getting this error:

Object literal may only specify known properties, and 'UrlLoader' does not exist in type 'LoaderOption'.ts(2353)
core.d.ts(128, 3): The expected type comes from property 'loaders' which is declared here on type 'ConfigOptions'

Versions:

"@graphql-markdown/docusaurus": "^1.29.0",
"@graphql-markdown/types": "^1.7.0",
"@graphql-tools/url-loader": "^8.0.31",

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions