Skip to content

Graphql rendering breaks when using schema extension syntax #134

@MTG2000

Description

@MTG2000

Basically, the issue happens whenever the code snippet has any schema extension syntax extend schema ...

Example:

extend schema @link(url: "https://somelink.com", import: ["InputValueSet", "UrlTemplate"])

directive @restEndpoint(
  name: String,
  baseUrl: String!
) repeatable on SCHEMA

directive @rest(
  endpoint: String,
  method: HttpMethod
  path: UrlTemplate!
  selection: UrlTemplate
) on FIELD_DEFINITION

enum HttpMethod {
  GET
  POST
  PUT
  DELETE
}

As you can see, all the types/enums after the extend line won't be tokenized correctly. & this doesn't look good.

Even though schema validation is valid graphql syntax.
https://spec.graphql.org/October2021/#sec-Schema-Extension
https://specs.apollo.dev/link/v1.0/

Maybe this has to do with the fact shikijs is using prisma-labs/vscode-graphql which is old & not anymore supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions