graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

[lsp-server] Add Yarn PnP Support

Open dbasilio opened this issue 2 months ago • 0 comments

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:

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.

dbasilio avatar Nov 17 '25 18:11 dbasilio