graphql / graphql/graphiql

[lsp-server] Add Yarn PnP Support

Open
#4,129 0 comments 0 reactions 0 assignees View on GitHub
enhancement lsp-server
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

## Current Behavior (if applicable)

We have a lot of different repos that need access to the same graphql-config settings, so we moved the configuration into a shared package. The goal being that if we need to make updates to the config in the future, we could make the update in one place and the push updates out the consumers.

Some of the consumer repos using Yarn PnP and some don't. The `graphql.config.ts` file in each repo looks something like this:
```ts
import { getGraphQLConfig } from "@namespace/graphql-config";

export default getGraphQLConfig();
```

This works fine in repos that are not PnP, but fails in those that are with `Cannot find module '@namespace/graphql-config'`

## Desired Behavior

Either provide a way to add a custom loader for the graphql-language-server to use, or perhaps look into adding a yarn sdk for the graphql-language-server https://yarnpkg.com/getting-started/editor-sdks to do the resolution to monkey patch the resolution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.